From 3f814e75823dcef29a2f4ee5b22c94830a85a0e2 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 6 Feb 2020 18:31:13 +0000 Subject: [PATCH] Fix Flow type for React Native (#17992) --- packages/react-native-renderer/src/ReactNativeComponent.js | 6 +----- packages/react-native-renderer/src/ReactNativeTypes.js | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/react-native-renderer/src/ReactNativeComponent.js b/packages/react-native-renderer/src/ReactNativeComponent.js index 795c666474a68..fe0425e04e333 100644 --- a/packages/react-native-renderer/src/ReactNativeComponent.js +++ b/packages/react-native-renderer/src/ReactNativeComponent.js @@ -41,16 +41,12 @@ export default function( * * @abstract */ - class ReactNativeComponent extends React.Component< - Props, - State, - > { + class ReactNativeComponent extends React.Component { /** * 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()`. diff --git a/packages/react-native-renderer/src/ReactNativeTypes.js b/packages/react-native-renderer/src/ReactNativeTypes.js index b062d06564090..013058a996e97 100644 --- a/packages/react-native-renderer/src/ReactNativeTypes.js +++ b/packages/react-native-renderer/src/ReactNativeTypes.js @@ -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>, @@ -157,7 +157,7 @@ export type ReactNativeType = { }; export type ReactFabricType = { - NativeComponent: _InternalReactNativeComponentClass<{...}>, + NativeComponent: typeof ReactNativeComponent, findHostInstance_DEPRECATED(componentOrHandle: any): ?HostComponent, findNodeHandle(componentOrHandle: any): ?number, dispatchCommand(handle: any, command: string, args: Array): void,