Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flow] Eliminate a few React.Element type that will be synced to react-native #30719

Merged
merged 8 commits into from
Aug 16, 2024
Merged

[flow] Eliminate a few React.Element type that will be synced to react-native #30719

merged 8 commits into from
Aug 16, 2024

Conversation

SamChou19815
Copy link
Contributor

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

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`.
Copy link

vercel bot commented Aug 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 16, 2024 3:38pm

@react-sizebot
Copy link

react-sizebot commented Aug 16, 2024

Comparing: fa6eab5...fd5b3b2

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.05% 1.82 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 500.37 kB 500.37 kB = 89.80 kB 89.80 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 507.50 kB 507.50 kB = 90.96 kB 90.96 kB
facebook-www/ReactDOM-prod.classic.js = 595.24 kB 595.24 kB = 105.55 kB 105.55 kB
facebook-www/ReactDOM-prod.modern.js = 571.54 kB 571.54 kB = 101.75 kB 101.75 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against c41e63b

@SamChou19815 SamChou19815 changed the title [flow] Eliminate the last React.Element type use in react codebase [flow] Eliminate the last few React.Element type use in react codebase Aug 16, 2024
@SamChou19815 SamChou19815 changed the title [flow] Eliminate the last few React.Element type use in react codebase [flow] Eliminate a few React.Element type that will be synced to react-native Aug 16, 2024
@SamChou19815 SamChou19815 marked this pull request as ready for review August 16, 2024 15:41
Copy link
Contributor

@josephsavona josephsavona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sam!

@SamChou19815 SamChou19815 merged commit 85fb95c into facebook:main Aug 16, 2024
185 checks passed
@SamChou19815 SamChou19815 deleted the patch-1 branch August 16, 2024 16:54
github-actions bot pushed a commit that referenced this pull request Aug 16, 2024
…t-native (#30719)

## 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 85fb95c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants