Skip to content

Commit 39c338f

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Eliminate a few React.Element type that will be synced to react-native (#30719)
Summary: ## Summary Flow will eventually remove the specific `React.Element` type. For most of the code, it can be replaced with `React.MixedElement` or `React.Node`. When specific react elements are required, it needs to be replaced with either `React$Element` which will trigger a `internal-type` lint error that can be disabled project-wide, or use `ExactReactElement_DEPRECATED`. Fortunately in this case, this one can be replaced with just `React.MixedElement`. ## How did you test this change? `flow` DiffTrain build for commit facebook/react@85fb95c. bypass-github-export-checks Reviewed By: poteto Differential Revision: D61397212 Pulled By: SamChou19815 fbshipit-source-id: c0aa5a4ed3922f88b7e557738f76f872c02a9d07
1 parent 77154c6 commit 39c338f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
* @noformat
88
* @nolint
99
* @flow strict
10-
* @generated SignedSource<<4405023a5d82ddc01db31d8eb46a7aa0>>
10+
* @generated SignedSource<<89361333bb6b688486e35849a9c669a6>>
1111
*/
1212

13-
import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
13+
import type {
14+
ElementRef,
15+
ElementType,
16+
MixedElement,
17+
AbstractComponent,
18+
} from 'react';
1419

1520
export type MeasureOnSuccessCallback = (
1621
x: number,
@@ -222,7 +227,7 @@ export type ReactNativeType = {
222227
eventType: string,
223228
): void,
224229
render(
225-
element: Element<ElementType>,
230+
element: MixedElement,
226231
containerTag: number,
227232
callback: ?() => void,
228233
options: ?RenderRootOptions,
@@ -257,7 +262,7 @@ export type ReactFabricType = {
257262
eventType: string,
258263
): void,
259264
render(
260-
element: Element<ElementType>,
265+
element: MixedElement,
261266
containerTag: number,
262267
callback: ?() => void,
263268
concurrentRoot: ?boolean,

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7912,7 +7912,7 @@ export type ReactNativeType = {
79127912
eventType: string
79137913
): void,
79147914
render(
7915-
element: Element<ElementType>,
7915+
element: MixedElement,
79167916
containerTag: number,
79177917
callback: ?() => void,
79187918
options: ?RenderRootOptions
@@ -7945,7 +7945,7 @@ export type ReactFabricType = {
79457945
eventType: string
79467946
): void,
79477947
render(
7948-
element: Element<ElementType>,
7948+
element: MixedElement,
79497949
containerTag: number,
79507950
callback: ?() => void,
79517951
concurrentRoot: ?boolean,

0 commit comments

Comments
 (0)