-
Notifications
You must be signed in to change notification settings - Fork 1.1k
5.5.3 breaks testing for React 15 #287
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
Labels
Comments
Ah, yep, that'll do it. The fix is to render |
alexzherdev
pushed a commit
to alexzherdev/react-testing-library
that referenced
this issue
Feb 8, 2019
alexzherdev
pushed a commit
to alexzherdev/react-testing-library
that referenced
this issue
Feb 8, 2019
kentcdodds
pushed a commit
that referenced
this issue
Feb 8, 2019
🎉 This issue has been resolved in version 5.5.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
react-testing-library
version: 5.5.3react
version: 15.6.2node
version: 10npm
(oryarn
) version: yarn 1.13Relevant code or config:
What you did:
Just recently installed the library and was trying to write my first tests. Everything was working fine until I updated to 5.5.3.
What happened:
Trying to render anything in tests results in
ReactDOM.render(): Invalid component element.
Reproduction:
https://codesandbox.io/s/lxzrym3p9q
Problem description:
This seems to be the culprit: https://github.com/kentcdodds/react-testing-library/blob/1d45c5c2ca1281187dc7735ac0e2f12137b157d3/src/act-compat.js#L10
Rendering
null
only works in React 16, not in 15.x.Suggested solution:
I'm actually not too sure why that line is necessary in the first place. Why is just calling
ReactDOM.unstable_batchedUpdates
not enough?The text was updated successfully, but these errors were encountered: