mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
[flow] Eliminate usage of global React types in ReactNativeTypes.js (#32330)
This commit is contained in:
parent
885532c124
commit
70f1d766e8
|
|
@ -9,7 +9,13 @@
|
|||
* @flow strict
|
||||
*/
|
||||
|
||||
import type {ElementRef, ElementType, MixedElement} from 'react';
|
||||
import type {
|
||||
Component as ReactComponent,
|
||||
ElementRef,
|
||||
ElementType,
|
||||
MixedElement,
|
||||
RefSetter,
|
||||
} from 'react';
|
||||
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
|
||||
import {type PublicRootInstance} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
|
||||
|
||||
|
|
@ -135,7 +141,7 @@ declare const ensureNativeMethodsAreSynced: NativeMethods;
|
|||
|
||||
export type HostInstance = NativeMethods;
|
||||
export type HostComponent<Config: {...}> = component(
|
||||
ref: React$RefSetter<HostInstance>,
|
||||
ref: RefSetter<HostInstance>,
|
||||
...Config
|
||||
);
|
||||
|
||||
|
|
@ -188,7 +194,8 @@ export type RenderRootOptions = {
|
|||
errorInfo: {
|
||||
+componentStack?: ?string,
|
||||
// $FlowFixMe[unclear-type] unknown props and state.
|
||||
+errorBoundary?: ?React$Component<any, any>,
|
||||
// $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
|
||||
+errorBoundary?: ?ReactComponent<any, any>,
|
||||
},
|
||||
) => void,
|
||||
onRecoverableError?: (
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ export type Key = React$Key;
|
|||
export type Node = React$Node;
|
||||
export type Context<T> = React$Context<T>;
|
||||
export type Portal = React$Portal;
|
||||
export type RefSetter<-I> = React$RefSetter<I>;
|
||||
export type ElementProps<C> = React$ElementProps<C>;
|
||||
export type ElementConfig<C> = React$ElementConfig<C>;
|
||||
export type ElementRef<C> = React$ElementRef<C>;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user