@samitouri / QOS-React / commits / 3f814e7582

Fix Flow type for React Native (#17992)

Dan Abramov committed Feb 6, 2020 at 18:31 UTC 3f814e75823dcef29a2f4ee5b22c94830a85a0e2
2 files changed +3 -7
packages/react-native-renderer/src/ReactNativeComponent.js
+1 -5
@@ -41,16 +41,12 @@ export default function(
41 *
42 * @abstract
43 */
44 - class ReactNativeComponent<Props, State = void> extends React.Component<
45 - Props,
46 - State,
47 - > {
44 + class ReactNativeComponent<Props> extends React.Component<Props> {
45 /**
46 * Due to bugs in Flow's handling of React.createClass, some fields already
47 * declared in the base class need to be redeclared below.
48 */
49 props: Props;
53 - state: State;
50
51 /**
52 * Removes focus. This is the opposite of `focus()`.
packages/react-native-renderer/src/ReactNativeTypes.js
+2 -2
@@ -137,7 +137,7 @@ type SecretInternalsFabricType = {
137 * Provide minimal Flow typing for the high-level RN API and call it a day.
138 */
139 export type ReactNativeType = {
140 - NativeComponent: _InternalReactNativeComponentClass<{...}>,
140 + NativeComponent: typeof ReactNativeComponent,
141 findHostInstance_DEPRECATED(
142 componentOrHandle: any,
143 ): ?ElementRef<HostComponent<mixed>>,
@@ -157,7 +157,7 @@ export type ReactNativeType = {
157 };
158
159 export type ReactFabricType = {
160 - NativeComponent: _InternalReactNativeComponentClass<{...}>,
160 + NativeComponent: typeof ReactNativeComponent,
161 findHostInstance_DEPRECATED(componentOrHandle: any): ?HostComponent<mixed>,
162 findNodeHandle(componentOrHandle: any): ?number,
163 dispatchCommand(handle: any, command: string, args: Array<any>): void,