Skip to content

Commit

Permalink
Add ReactNativeTypes for root options (#28850)
Browse files Browse the repository at this point in the history
Flow should have failed for this but didn't, we need these options
sync'd over in the types too.

DiffTrain build for commit 657428a.
  • Loading branch information
rickhanlonii committed Apr 17, 2024
1 parent 8017f27 commit 63dd85f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0347fcd0073cf529f67a05be86a0545c3efab8e2
657428a9e960cc9c208498be7d2e293007d85cbd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noformat
* @flow strict
* @nolint
* @generated SignedSource<<b35184ab7e1e173fd34278def089e277>>
* @generated SignedSource<<f33ee88cc50bb00a16d281dce9952e21>>
*/

import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
Expand Down Expand Up @@ -217,6 +217,24 @@ 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 All @@ -239,6 +257,7 @@ export type ReactFabricType = {
containerTag: number,
callback: ?() => void,
concurrentRoot: ?boolean,
options: ?RenderRootOptions,
): ?ElementRef<ElementType>,
unmountComponentAtNode(containerTag: number): void,
getNodeFromInternalInstanceHandle(
Expand Down

0 comments on commit 63dd85f

Please sign in to comment.