diff --git a/packages/react-native-renderer/src/ReactNativeTypes.js b/packages/react-native-renderer/src/ReactNativeTypes.js index 94237f386623b..1b38ed2ad9608 100644 --- a/packages/react-native-renderer/src/ReactNativeTypes.js +++ b/packages/react-native-renderer/src/ReactNativeTypes.js @@ -174,6 +174,25 @@ export type TouchedViewDataAtPoint = $ReadOnly<{ ...InspectorData, }>; +export type RenderRootOptions = { + onUncaughtError?: ( + error: mixed, + errorInfo: {+componentStack?: ?string}, + ) => void, + onCaughtError?: ( + error: mixed, + errorInfo: { + +componentStack?: ?string, + // $FlowFixMe[unclear-type] unknown props and state. + +errorBoundary?: ?React$Component, + }, + ) => void, + onRecoverableError?: ( + error: mixed, + errorInfo: {+componentStack?: ?string}, + ) => void, +}; + /** * Flat ReactNative renderer bundles are too big for Flow to parse efficiently. * Provide minimal Flow typing for the high-level RN API and call it a day. @@ -202,6 +221,7 @@ export type ReactNativeType = { element: Element, containerTag: number, callback: ?() => void, + options: ?RenderRootOptions, ): ?ElementRef, unmountComponentAtNode(containerTag: number): void, unmountComponentAtNodeAndRemoveContainer(containerTag: number): void, @@ -215,24 +235,6 @@ export opaque type InternalInstanceHandle = mixed; type PublicInstance = mixed; type PublicTextInstance = mixed; -export type RenderRootOptions = { - onUncaughtError?: ( - error: mixed, - errorInfo: {+componentStack?: ?string}, - ) => void, - onCaughtError?: ( - error: mixed, - errorInfo: { - +componentStack?: ?string, - +errorBoundary?: ?React$Component, - }, - ) => void, - onRecoverableError?: ( - error: mixed, - errorInfo: {+componentStack?: ?string}, - ) => void, -}; - export type ReactFabricType = { findHostInstance_DEPRECATED( componentOrHandle: ?(ElementRef | number),