GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ReactNativeTypes for root options (#28850) · react/react@657428a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-native-renderer/src
    • ReactFabric.js
    • ReactNativeRenderer.js
    • ReactNativeTypes.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-native-renderer/src/ReactFabric.js‎

Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/ReactFabric.js
+2-19Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import type {ReactPortal, ReactNodeList} from 'shared/ReactTypes';
1111
import type {ElementRef, Element, ElementType} from 'react';
1212
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
13+
import type {RenderRootOptions} from './ReactNativeTypes';
1314

1415
import './ReactFabricInjection';
1516

@@ -101,30 +102,12 @@ function nativeOnCaughtError(
101102
defaultOnCaughtError(error, errorInfo);
102103
}
103104

104-
type NativeRenderOptions = {
105-
onUncaughtError?: (
106-
error: mixed,
107-
errorInfo: {+componentStack?: ?string},
108-
) => void,
109-
onCaughtError?: (
110-
error: mixed,
111-
errorInfo: {
112-
+componentStack?: ?string,
113-
+errorBoundary?: ?React$Component<any, any>,
114-
},
115-
) => void,
116-
onRecoverableError?: (
117-
error: mixed,
118-
errorInfo: {+componentStack?: ?string},
119-
) => void,
120-
};
121-
122105
function render(
123106
element: Element<ElementType>,
124107
containerTag: number,
125108
callback: ?() => void,
126109
concurrentRoot: ?boolean,
127-
options?: NativeRenderOptions,
110+
options: ?RenderRootOptions,
128111
): ?ElementRef<ElementType> {
129112
if (disableLegacyMode && !concurrentRoot) {
130113
throw new Error('render: Unsupported Legacy Mode API.');
Collapse file

‎packages/react-native-renderer/src/ReactNativeRenderer.js‎

Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/ReactNativeRenderer.js
+2-19Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import type {ReactPortal, ReactNodeList} from 'shared/ReactTypes';
1111
import type {ElementRef, Element, ElementType} from 'react';
1212
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
13+
import type {RenderRootOptions} from './ReactNativeTypes';
1314

1415
import './ReactNativeInjection';
1516

@@ -106,29 +107,11 @@ function nativeOnCaughtError(
106107
defaultOnCaughtError(error, errorInfo);
107108
}
108109

109-
type NativeRenderOptions = {
110-
onUncaughtError?: (
111-
error: mixed,
112-
errorInfo: {+componentStack?: ?string},
113-
) => void,
114-
onCaughtError?: (
115-
error: mixed,
116-
errorInfo: {
117-
+componentStack?: ?string,
118-
+errorBoundary?: ?React$Component<any, any>,
119-
},
120-
) => void,
121-
onRecoverableError?: (
122-
error: mixed,
123-
errorInfo: {+componentStack?: ?string},
124-
) => void,
125-
};
126-
127110
function render(
128111
element: Element<ElementType>,
129112
containerTag: number,
130113
callback: ?() => void,
131-
options?: NativeRenderOptions,
114+
options: ?RenderRootOptions,
132115
): ?ElementRef<ElementType> {
133116
if (disableLegacyMode) {
134117
throw new Error('render: Unsupported Legacy Mode API.');
Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/ReactNativeTypes.js
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,24 @@ export opaque type InternalInstanceHandle = mixed;
215215
type PublicInstance = mixed;
216216
type PublicTextInstance = mixed;
217217

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+
218236
export type ReactFabricType = {
219237
findHostInstance_DEPRECATED<TElementType: ElementType>(
220238
componentOrHandle: ?(ElementRef<TElementType> | number),
@@ -237,6 +255,7 @@ export type ReactFabricType = {
237255
containerTag: number,
238256
callback: ?() => void,
239257
concurrentRoot: ?boolean,
258+
options: ?RenderRootOptions,
240259
): ?ElementRef<ElementType>,
241260
unmountComponentAtNode(containerTag: number): void,
242261
getNodeFromInternalInstanceHandle(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.