dillon1000/react
Commit
Browse files Deprecate ReactDOM.render and ReactDOM.hydrate (#21652)
* 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: https://github.com/reactjs/reactjs.org/pull/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.
Changed paths10 files
First-parent comparisonfixtures/dom/src/__tests__/wrong-act-test.js ModifiedM packages/react-devtools-shared/src/__tests__/inspectedElement-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMFiber-test.js ModifiedM packages/react-dom/src/__tests__/ReactErrorBoundaries-test.internal.js ModifiedM packages/react-dom/src/__tests__/ReactErrorLoggingRecovery-test.js ModifiedM packages/react-dom/src/__tests__/ReactLegacyErrorBoundaries-test.internal.js ModifiedA packages/react-dom/src/__tests__/ReactLegacyRootWarnings-test.js AddedM packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js ModifiedM packages/react-dom/src/client/ReactDOMLegacy.js ModifiedM scripts/jest/shouldIgnoreConsoleError.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…