-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
Warning: ReactDOM.render is no longer supported in React 18 when using ReactTestUtils.renderIntoDocument #25446
Comments
Yeah, TestUtils are essentially on life support. We try not to break them but they're frozen in functionality. |
Thank you for the quick reply. |
@gaearon but the legacy
I wonder if this is what you meant .... i use the testing library to render the component and place a ref on it so i still have access to the component instance ? |
ReactTestUtils.render is deprecated: facebook/react#25446
ReactTestUtils.render is deprecated: facebook/react#25446 Also, the Xhr tests were failing with some node-fetch errors - I think it's fine to just remove these as they weren't actually asserting any business logic.
ReactTestUtils.render is deprecated: facebook/react#25446 Also, the Xhr tests were failing with some node-fetch errors - I think it's fine to just remove these as they weren't actually asserting any business logic.
ReactTestUtils.render is deprecated: facebook/react#25446 Also, the Xhr tests were failing with some node-fetch errors - I think it's fine to just remove these as they weren't actually asserting any business logic.
Is there any progress on this issue? |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
React version: 18.2.0
ReactDOM version: 18.2.0
Steps To Reproduce
ReactTestUtils.renderIntoDocument
methodExample code:
The current behavior
When using
ReactTestUtils.renderIntoDocument
in React 18, I have the following warning in the console, that make the test fail:It seems to come from this line in the source code:
react/packages/react-dom/src/test-utils/ReactTestUtils.js
Line 128 in 7b25b96
The expected behavior
I expect the
ReactTestUtils.renderIntoDocument
method not to trigger aconsole.error
and to return a DOM Node.I know most of the people are probably using
@testing-library/react
these days, should we expect the React Test Utilities to be deprecated soon?Thank you for reading.
The text was updated successfully, but these errors were encountered: