Skip to content

Commit

Permalink
Fix Flow type for React Native (#17992)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Feb 6, 2020
1 parent 256d78d commit 3f814e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions packages/react-native-renderer/src/ReactNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ export default function(
*
* @abstract
*/
class ReactNativeComponent<Props, State = void> extends React.Component<
Props,
State,
> {
class ReactNativeComponent<Props> extends React.Component<Props> {
/**
* Due to bugs in Flow's handling of React.createClass, some fields already
* declared in the base class need to be redeclared below.
*/
props: Props;
state: State;

/**
* Removes focus. This is the opposite of `focus()`.
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-renderer/src/ReactNativeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ type SecretInternalsFabricType = {
* Provide minimal Flow typing for the high-level RN API and call it a day.
*/
export type ReactNativeType = {
NativeComponent: _InternalReactNativeComponentClass<{...}>,
NativeComponent: typeof ReactNativeComponent,
findHostInstance_DEPRECATED(
componentOrHandle: any,
): ?ElementRef<HostComponent<mixed>>,
Expand All @@ -157,7 +157,7 @@ export type ReactNativeType = {
};

export type ReactFabricType = {
NativeComponent: _InternalReactNativeComponentClass<{...}>,
NativeComponent: typeof ReactNativeComponent,
findHostInstance_DEPRECATED(componentOrHandle: any): ?HostComponent<mixed>,
findNodeHandle(componentOrHandle: any): ?number,
dispatchCommand(handle: any, command: string, args: Array<any>): void,
Expand Down

0 comments on commit 3f814e7

Please sign in to comment.