Drop usage of react-dom/test-utils
BREAKING CHANGE
The legacyRoot option is no longer supported now that ReactDOM.render has been removed from React. There is no alternative.
To ensure compatibility with React Testing Library 15, make sure you're not using the legacyRoot option in any of your calls to render from React Testing Library.
React 18 is still supported but you will see deprecation warnings from react-dom/test-utils. Either suppress these warnings or switch to React 19.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 997c8c1e4b86dee664f3f219706092cc32582dd8:
| Sandbox | Source |
|---|---|
| React | Configuration |
| react-testing-library-examples | Configuration |
Thanks Sebastian. Is there any documentation about this change? Are they just deprecating the module?
Thanks Sebastian. Is there any documentation about this change? Are they just deprecating the module?
This is the related doc.
Thanks Sebastian. Is there any documentation about this change? Are they just deprecating the module?
This is the related doc.
Thanks.. This was created by @eps1lon himself :)
https://github.com/reactjs/react.dev/blob/main/src/content/warnings/react-dom-test-utils.md
Favoring https://github.com/testing-library/react-testing-library/pull/1294 which adds React 19 support in a SemVer MINOR.