Deprecate ReactDOM.render and ReactDOM.hydrate#21652
Merged
acdlite merged 2 commits intofacebook:masterfrom Jun 9, 2021
Merged
Deprecate ReactDOM.render and ReactDOM.hydrate#21652acdlite merged 2 commits intofacebook:masterfrom
acdlite merged 2 commits intofacebook:masterfrom
Conversation
We have a warning filter for our internal tests to ignore warnings that are too noisy or that we haven't removed from our test suite yet: shouldIgnoreConsoleError. Many of our server rendering tests don't use this filter, though, because it has its own special of asserting warnings. So I added the warning filter to the server tests, too.
These are no longer supported in React 18. They are replaced by the `createRoot` API. The warning includes a link to documentation of the new API. Currently it redirects to the corresponding working group post. Here's the PR to set up the redirect: reactjs/react.dev#3730 Many of our tests still use ReactDOM.render. We will need to gradually migrate them over to createRoot. In the meantime, I added the warnings to our internal warning filter.
acdlite
commented
Jun 9, 2021
| 'use strict'; | ||
|
|
||
| const stream = require('stream'); | ||
| const shouldIgnoreConsoleError = require('../../../../../scripts/jest/shouldIgnoreConsoleError'); |
sebmarkbage
approved these changes
Jun 9, 2021
6d8823d to
b5d54fa
Compare
|
Comparing: 1a3f1af...0cc374a Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
b5d54fa to
0cc374a
Compare
eps1lon
reviewed
Jun 10, 2021
| ) { | ||
| if (__DEV__) { | ||
| console.error( | ||
| 'ReactDOM.render is no longer supported in React 18. Use createRoot ' + |
Collaborator
There was a problem hiding this comment.
Maybe use "ReactDOM.render is deprecated in React 18" instead for consistent messaging? "not supported" sounds like it's no longer working. Unless the other deprecation warnings also use "not supported" instead of "deprecated".
koto
pushed a commit
to koto/react
that referenced
this pull request
Jun 15, 2021
* Use existing test warning filter for server tests We have a warning filter for our internal tests to ignore warnings that are too noisy or that we haven't removed from our test suite yet: shouldIgnoreConsoleError. Many of our server rendering tests don't use this filter, though, because it has its own special of asserting warnings. So I added the warning filter to the server tests, too. * Deprecate ReactDOM.render and ReactDOM.hydrate These are no longer supported in React 18. They are replaced by the `createRoot` API. The warning includes a link to documentation of the new API. Currently it redirects to the corresponding working group post. Here's the PR to set up the redirect: reactjs/react.dev#3730 Many of our tests still use ReactDOM.render. We will need to gradually migrate them over to createRoot. In the meantime, I added the warnings to our internal warning filter.
rickhanlonii
reviewed
Sep 7, 2021
| ) { | ||
| if (__DEV__) { | ||
| console.error( | ||
| 'ReactDOM.hydrate is no longer supported in React 18. Use createRoot ' + |
Member
There was a problem hiding this comment.
Is it weird that we say "no longer supported in React 18" as if it was ever supported in React 18?
Member
There was a problem hiding this comment.
ReactDOM.hydrate is deprecated in React 18.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are no longer supported in React 18. They are replaced by the
createRootAPI.The warning includes a link to documentation of the new API. Currently it redirects to the corresponding working group post:
https://reactjs.org/link/switch-to-createroot
Many of our tests still use ReactDOM.render. We will need to gradually migrate them over to createRoot.
In the meantime, I added the warnings to our internal warning filter.