Skip to content

Commit

Permalink
Update ReactNativeTypes for root options (part 2) (#28857)
Browse files Browse the repository at this point in the history
Forgot to push a change before mergin
#28850

DiffTrain build for commit b5e5ce8.
  • Loading branch information
rickhanlonii committed Apr 17, 2024
1 parent 6130570 commit ed70677
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
da6ba53b10d8240fc251ba14a3e5878604d3dc7d
b5e5ce8e0a899345dab1ce71c74bc1d1c28c6a0d
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noformat
* @flow strict
* @nolint
* @generated SignedSource<<f33ee88cc50bb00a16d281dce9952e21>>
* @generated SignedSource<<c41f61379973354629ee7bf55ba92541>>
*/

import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
Expand Down Expand Up @@ -176,6 +176,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<any, any>,
},
) => 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.
Expand Down Expand Up @@ -204,6 +223,7 @@ export type ReactNativeType = {
element: Element<ElementType>,
containerTag: number,
callback: ?() => void,
options: ?RenderRootOptions,
): ?ElementRef<ElementType>,
unmountComponentAtNode(containerTag: number): void,
unmountComponentAtNodeAndRemoveContainer(containerTag: number): void,
Expand All @@ -217,24 +237,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<any, any>,
},
) => void,
onRecoverableError?: (
error: mixed,
errorInfo: {+componentStack?: ?string},
) => void,
};

export type ReactFabricType = {
findHostInstance_DEPRECATED<TElementType: ElementType>(
componentOrHandle: ?(ElementRef<TElementType> | number),
Expand Down

0 comments on commit ed70677

Please sign in to comment.