Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions packages/react-native-renderer/src/ReactNativeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
);

Expand Down Expand Up @@ -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?: (
Expand Down
1 change: 1 addition & 0 deletions packages/react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
Loading