Skip to content

Commit

Permalink
Eliminate a few React.Element type that will be synced to react-native (
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Aug 16, 2024
1 parent 77154c6 commit 39c338f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
* @noformat
* @nolint
* @flow strict
* @generated SignedSource<<4405023a5d82ddc01db31d8eb46a7aa0>>
* @generated SignedSource<<89361333bb6b688486e35849a9c669a6>>
*/

import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
import type {
ElementRef,
ElementType,
MixedElement,
AbstractComponent,
} from 'react';

export type MeasureOnSuccessCallback = (
x: number,
Expand Down Expand Up @@ -222,7 +227,7 @@ export type ReactNativeType = {
eventType: string,
): void,
render(
element: Element<ElementType>,
element: MixedElement,
containerTag: number,
callback: ?() => void,
options: ?RenderRootOptions,
Expand Down Expand Up @@ -257,7 +262,7 @@ export type ReactFabricType = {
eventType: string,
): void,
render(
element: Element<ElementType>,
element: MixedElement,
containerTag: number,
callback: ?() => void,
concurrentRoot: ?boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7912,7 +7912,7 @@ export type ReactNativeType = {
eventType: string
): void,
render(
element: Element<ElementType>,
element: MixedElement,
containerTag: number,
callback: ?() => void,
options: ?RenderRootOptions
Expand Down Expand Up @@ -7945,7 +7945,7 @@ export type ReactFabricType = {
eventType: string
): void,
render(
element: Element<ElementType>,
element: MixedElement,
containerTag: number,
callback: ?() => void,
concurrentRoot: ?boolean,
Expand Down

0 comments on commit 39c338f

Please sign in to comment.