Fix Flow type for React Native (#17992)

This commit is contained in:
Dan Abramov
2020-02-06 18:31:13 +00:00
committed by GitHub
parent 985a2438fc
commit f49e5bfacb
2 changed files with 3 additions and 7 deletions
+1 -5
View File
@@ -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()`.
+2 -2
View File
@@ -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>>,
@@ -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,