Skip to content

Remove "hoist-non-react-statics" from global type declaration #1480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions generatedTypes/components/scrollBar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ declare const Item: {
displayName: string;
};
declare const _default: React.ComponentClass<ScrollBarProps & {
/**
useCustomTheme?: boolean | undefined; /**
* Whether to use a FlatList. NOTE: you must pass 'data' and 'renderItem' props as well
*/
useCustomTheme?: boolean | undefined;
}, any> & typeof ScrollBar;
export default _default;
6 changes: 3 additions & 3 deletions generatedTypes/helpers/AvatarHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export declare function getAvatarColors(): string[];
export declare function getColorById(id: string, avatarColors?: string[]): string;
export declare function getInitials(name?: string, limit?: number): string;
export declare function getBackgroundColor(name?: string, avatarColors?: string[], hashFunction?: (name?: string) => number, defaultColor?: string): string | undefined;
export declare function isGravatarUrl(url: string): any;
export declare function isBlankGravatarUrl(url: string): any;
export declare function patchGravatarUrl(gravatarUrl: string): any;
export declare function isGravatarUrl(url: string): boolean;
export declare function isBlankGravatarUrl(url: string): boolean;
export declare function patchGravatarUrl(gravatarUrl: string): string;
30 changes: 15 additions & 15 deletions generatedTypes/incubator/TextField/usePreset.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
onAccessibilityTap?: (() => void) | undefined;
onMagicTap?: (() => void) | undefined;
accessibilityIgnoresInvertColors?: boolean | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
onPressOut?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
allowFontScaling?: boolean | undefined;
numberOfLines?: number | undefined;
maxFontSizeMultiplier?: number | null | undefined;
selectionColor?: import("react-native").ColorValue | undefined;
textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined;
textAlign?: "left" | "right" | "center" | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
onPressOut?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
value?: string | undefined;
autoCapitalize?: "none" | "characters" | "sentences" | "words" | undefined;
Expand Down Expand Up @@ -126,7 +126,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
selectionState?: import("react-native").DocumentSelectionState | undefined;
spellCheck?: boolean | undefined;
textContentType?: "none" | "name" | "password" | "username" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "newPassword" | "oneTimeCode" | undefined;
autoCompleteType?: "email" | "name" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "password" | "postal-code" | "street-address" | "tel" | "username" | undefined;
autoCompleteType?: "name" | "password" | "username" | "email" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "postal-code" | "street-address" | "tel" | undefined;
importantForAutofill?: "auto" | "yes" | "no" | "noExcludeDescendants" | "yesExcludeDescendants" | undefined;
disableFullscreenUI?: boolean | undefined;
inlineImageLeft?: string | undefined;
Expand Down Expand Up @@ -409,16 +409,16 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
onAccessibilityTap?: (() => void) | undefined;
onMagicTap?: (() => void) | undefined;
accessibilityIgnoresInvertColors?: boolean | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
onPressOut?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
allowFontScaling?: boolean | undefined;
numberOfLines?: number | undefined;
maxFontSizeMultiplier?: number | null | undefined;
selectionColor?: import("react-native").ColorValue | undefined;
textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined;
textAlign?: "left" | "right" | "center" | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
onPressOut?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
value?: string | undefined;
autoCapitalize?: "none" | "characters" | "sentences" | "words" | undefined;
Expand Down Expand Up @@ -458,7 +458,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
selectionState?: import("react-native").DocumentSelectionState | undefined;
spellCheck?: boolean | undefined;
textContentType?: "none" | "name" | "password" | "username" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "newPassword" | "oneTimeCode" | undefined;
autoCompleteType?: "email" | "name" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "password" | "postal-code" | "street-address" | "tel" | "username" | undefined;
autoCompleteType?: "name" | "password" | "username" | "email" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "postal-code" | "street-address" | "tel" | undefined;
importantForAutofill?: "auto" | "yes" | "no" | "noExcludeDescendants" | "yesExcludeDescendants" | undefined;
disableFullscreenUI?: boolean | undefined;
inlineImageLeft?: string | undefined;
Expand Down Expand Up @@ -853,16 +853,16 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
onAccessibilityTap?: (() => void) | undefined;
onMagicTap?: (() => void) | undefined;
accessibilityIgnoresInvertColors?: boolean | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
onPressOut?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
allowFontScaling?: boolean | undefined;
numberOfLines?: number | undefined;
maxFontSizeMultiplier?: number | null | undefined;
selectionColor?: import("react-native").ColorValue | undefined;
textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined;
textAlign?: "left" | "right" | "center" | undefined;
onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
onPressIn?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
onPressOut?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined;
textAlignVertical?: "auto" | "center" | "top" | "bottom" | undefined;
value?: string | undefined;
autoCapitalize?: "none" | "characters" | "sentences" | "words" | undefined;
Expand Down Expand Up @@ -902,7 +902,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
selectionState?: import("react-native").DocumentSelectionState | undefined;
spellCheck?: boolean | undefined;
textContentType?: "none" | "name" | "password" | "username" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "newPassword" | "oneTimeCode" | undefined;
autoCompleteType?: "email" | "name" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "password" | "postal-code" | "street-address" | "tel" | "username" | undefined;
autoCompleteType?: "name" | "password" | "username" | "email" | "off" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "postal-code" | "street-address" | "tel" | undefined;
importantForAutofill?: "auto" | "yes" | "no" | "noExcludeDescendants" | "yesExcludeDescendants" | undefined;
disableFullscreenUI?: boolean | undefined;
inlineImageLeft?: string | undefined;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"@react-native-community/netinfo": "^5.6.2",
"@react-native-picker/picker": "^1.9.4",
"@testing-library/react-hooks": "^3.4.2",
"@types/hoist-non-react-statics": "^3.3.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the main change (added to devDependencies)

"@types/lodash": "^4.0.0",
"@types/prop-types": "^15.5.3",
"@types/react-native": "0.64.1",
Expand Down
2 changes: 0 additions & 2 deletions src/commons/asBaseComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import {Appearance} from 'react-native';
//@ts-ignore
import hoistStatics from 'hoist-non-react-statics';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noticed that //@ts-ignore is used in a lot of places due to undeclared hoist-non-react-statics, so I removed those.

//@ts-ignore
import * as Modifiers from './modifiers';
import forwardRef from './forwardRef';
import UIComponent from './UIComponent';
Expand Down
1 change: 0 additions & 1 deletion src/commons/forwardRef.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
//@ts-ignore
import hoistStatics from 'hoist-non-react-statics';

export interface ForwardRefInjectedProps {
Expand Down
1 change: 0 additions & 1 deletion src/commons/withScrollEnabler.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, {useState, useCallback, useRef} from 'react';
import {FlatListProps, ScrollViewProps, LayoutChangeEvent} from 'react-native';
import forwardRef, {ForwardRefInjectedProps} from './forwardRef';
//@ts-ignore
import hoistStatics from 'hoist-non-react-statics';

type ScrollEnablerProps = {
Expand Down
1 change: 0 additions & 1 deletion src/commons/withScrollReached.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, {useState, useCallback} from 'react';
import {FlatListProps, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent} from 'react-native';
import forwardRef, {ForwardRefInjectedProps} from './forwardRef';
//@ts-ignore
import hoistStatics from 'hoist-non-react-statics';
import {Constants} from '../helpers';

Expand Down
1 change: 0 additions & 1 deletion src/components/image/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import _ from 'lodash';
import React, {PureComponent} from 'react';
//@ts-ignore
import hoistNonReactStatic from 'hoist-non-react-statics';
import {
StyleSheet,
Expand Down
1 change: 0 additions & 1 deletion src/components/radioGroup/asRadioGroupChild.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {Component} from 'react';
// @ts-ignore
import hoistStatics from 'hoist-non-react-statics';
import RadioGroupContext from './RadioGroupContext';

Expand Down
1 change: 0 additions & 1 deletion src/incubator/TextField/withFieldState.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// TODO: remove this file (was replaced with useFieldState hook)
import React, {useCallback, useState, useEffect, useMemo} from 'react';
import _ from 'lodash';
//@ts-ignore
import hoistStatics from 'hoist-non-react-statics';
import {TextInputProps} from 'react-native';
import validators from './validators';
Expand Down
3 changes: 0 additions & 3 deletions typings/globalTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ declare module 'react-native-color' {
declare const Gradient: any;
}

declare module 'hoist-non-react-statics';
declare module 'url-parse';

interface Extendable {
[key: string]: any;
}