Skip to content

Commit b5e5ce8

Browse files
authored
Update ReactNativeTypes for root options (part 2) (#28857)
Forgot to push a change before mergin #28850
1 parent da6ba53 commit b5e5ce8

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

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

+20-18
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,25 @@ export type TouchedViewDataAtPoint = $ReadOnly<{
174174
...InspectorData,
175175
}>;
176176

177+
export type RenderRootOptions = {
178+
onUncaughtError?: (
179+
error: mixed,
180+
errorInfo: {+componentStack?: ?string},
181+
) => void,
182+
onCaughtError?: (
183+
error: mixed,
184+
errorInfo: {
185+
+componentStack?: ?string,
186+
// $FlowFixMe[unclear-type] unknown props and state.
187+
+errorBoundary?: ?React$Component<any, any>,
188+
},
189+
) => void,
190+
onRecoverableError?: (
191+
error: mixed,
192+
errorInfo: {+componentStack?: ?string},
193+
) => void,
194+
};
195+
177196
/**
178197
* Flat ReactNative renderer bundles are too big for Flow to parse efficiently.
179198
* Provide minimal Flow typing for the high-level RN API and call it a day.
@@ -202,6 +221,7 @@ export type ReactNativeType = {
202221
element: Element<ElementType>,
203222
containerTag: number,
204223
callback: ?() => void,
224+
options: ?RenderRootOptions,
205225
): ?ElementRef<ElementType>,
206226
unmountComponentAtNode(containerTag: number): void,
207227
unmountComponentAtNodeAndRemoveContainer(containerTag: number): void,
@@ -215,24 +235,6 @@ export opaque type InternalInstanceHandle = mixed;
215235
type PublicInstance = mixed;
216236
type PublicTextInstance = mixed;
217237

218-
export type RenderRootOptions = {
219-
onUncaughtError?: (
220-
error: mixed,
221-
errorInfo: {+componentStack?: ?string},
222-
) => void,
223-
onCaughtError?: (
224-
error: mixed,
225-
errorInfo: {
226-
+componentStack?: ?string,
227-
+errorBoundary?: ?React$Component<any, any>,
228-
},
229-
) => void,
230-
onRecoverableError?: (
231-
error: mixed,
232-
errorInfo: {+componentStack?: ?string},
233-
) => void,
234-
};
235-
236238
export type ReactFabricType = {
237239
findHostInstance_DEPRECATED<TElementType: ElementType>(
238240
componentOrHandle: ?(ElementRef<TElementType> | number),

0 commit comments

Comments
 (0)