FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update templates to use React 18 `createRoot` by kyletsang · Pull Request #12220 · react/create-react-app · GitHub

Repository navigation

Update templates to use React 18 createRoot - #12220

Merged
iansu merged 1 commit into
react:mainfrom
kyletsang:update-reactdom-render
Apr 8, 2022
Merged

iansu merged 1 commit into
react:mainfrom
kyletsang:update-reactdom-render

Conversation

Copy link
Copy Markdown
Contributor

Fixes #12219

Since CRA installs React 18 by default now, we should update the template to use the new createRoot

kyletsang requested review from iansu and mrmckeb as code owners March 30, 2022 04:36

Copy link
Copy Markdown

Hi @kyletsang!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

kyletsang changed the title Update templates to use createRoot Update templates to use React 18 createRoot Apr 1, 2022
import reportWebVitals from './reportWebVitals';

ReactDOM.render(
const root = ReactDOM.createRoot(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Im also getting warnings in the default app.test.js file since it uses the render method from react testing library. Not sure if that needs a similar fix but in case you know better than i do i thought i'd point it out. Thanks so much for this PR i think it'll be really crucial going forward

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hey @jbenjoy2, the RTL changes will be done with #12223

Copy link
Copy Markdown
Member

Hey just checking in, what's blocking this?

Copy link
Copy Markdown
Contributor Author

Friendly ping @iansu and @mrmckeb. This PR is ready to merge.

iansu commented Apr 8, 2022

Copy link
Copy Markdown
Contributor

Now that the TypeScript types for React 18 are out nothing is blocking this. Does this need to be merged along with #12223?

Copy link
Copy Markdown
Contributor Author

Now that the TypeScript types for React 18 are out nothing is blocking this. Does this need to be merged along with #12223?

Yes, the RTL update should also be merged for react 18 compatibility.

Thanks!

iansu commented Apr 8, 2022

Copy link
Copy Markdown
Contributor

@kyletsang I merged the RTL PR. Do you mind updating this branch from main so we can re-run the tests?

iansu added this to the 5.0.1 milestone Apr 8, 2022
kyletsang force-pushed the update-reactdom-render branch from b5288ec to d9ae406 Compare April 8, 2022 20:57

Copy link
Copy Markdown
Contributor Author

@iansu done!

iansu merged commit 2eef1d0 into react:main Apr 8, 2022

iansu commented Apr 8, 2022

Copy link
Copy Markdown
Contributor

Thanks!

kyletsang deleted the update-reactdom-render branch April 8, 2022 22:05

Copy link
Copy Markdown

At which version, is this going to fix?

As far today(April 10th, 2022), the npx create-react-app doesn't pickup this change.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Browser console warning about React 18 and ReactDOM.render

6 participants


Back | FazBrowse Home | New Git URL