Skip to content

Commit 1f77ae4

Browse files
authored
[flow] Eliminate usage of global React types in ReactNativeTypes.js
1 parent 8759c5c commit 1f77ae4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
* @flow strict
1010
*/
1111

12-
import type {ElementRef, ElementType, MixedElement} from 'react';
12+
import type {
13+
Component as ReactComponent,
14+
ElementRef,
15+
ElementType,
16+
MixedElement,
17+
RefSetter,
18+
} from 'react';
1319

1420
export type MeasureOnSuccessCallback = (
1521
x: number,
@@ -133,7 +139,7 @@ declare const ensureNativeMethodsAreSynced: NativeMethods;
133139

134140
export type HostInstance = NativeMethods;
135141
export type HostComponent<Config: {...}> = component(
136-
ref: React$RefSetter<HostInstance>,
142+
ref: RefSetter<HostInstance>,
137143
...Config
138144
);
139145

@@ -185,7 +191,7 @@ export type RenderRootOptions = {
185191
errorInfo: {
186192
+componentStack?: ?string,
187193
// $FlowFixMe[unclear-type] unknown props and state.
188-
+errorBoundary?: ?React$Component<any, any>,
194+
+errorBoundary?: ?ReactComponent<any, any>,
189195
},
190196
) => void,
191197
onRecoverableError?: (

0 commit comments

Comments
 (0)