Skip to content

Commit 3f814e7

Browse files
authored
Fix Flow type for React Native (#17992)
1 parent 256d78d commit 3f814e7

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/react-native-renderer/src/ReactNativeComponent.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,12 @@ export default function(
4141
*
4242
* @abstract
4343
*/
44-
class ReactNativeComponent<Props, State = void> extends React.Component<
45-
Props,
46-
State,
47-
> {
44+
class ReactNativeComponent<Props> extends React.Component<Props> {
4845
/**
4946
* Due to bugs in Flow's handling of React.createClass, some fields already
5047
* declared in the base class need to be redeclared below.
5148
*/
5249
props: Props;
53-
state: State;
5450

5551
/**
5652
* Removes focus. This is the opposite of `focus()`.

packages/react-native-renderer/src/ReactNativeTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ type SecretInternalsFabricType = {
137137
* Provide minimal Flow typing for the high-level RN API and call it a day.
138138
*/
139139
export type ReactNativeType = {
140-
NativeComponent: _InternalReactNativeComponentClass<{...}>,
140+
NativeComponent: typeof ReactNativeComponent,
141141
findHostInstance_DEPRECATED(
142142
componentOrHandle: any,
143143
): ?ElementRef<HostComponent<mixed>>,
@@ -157,7 +157,7 @@ export type ReactNativeType = {
157157
};
158158

159159
export type ReactFabricType = {
160-
NativeComponent: _InternalReactNativeComponentClass<{...}>,
160+
NativeComponent: typeof ReactNativeComponent,
161161
findHostInstance_DEPRECATED(componentOrHandle: any): ?HostComponent<mixed>,
162162
findNodeHandle(componentOrHandle: any): ?number,
163163
dispatchCommand(handle: any, command: string, args: Array<any>): void,

0 commit comments

Comments
 (0)