-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dynamic imported React.lazy component using hooks throws 'Invalid hook call' #745
Comments
It's also throwing |
Hi @li-yifei, I tried to reproduce this in a new CRA and this doesn't reproduce, so following @eps1lon, can you reproduce this locally? |
Hello @MatanBobi
Sure, I'm trying to do that. Actually it first happened in my work project.
Sorry, it should be 10.4.5. I copied the version of |
@MatanBobi
After I upgraded to 10.4.6 the findByText call throwed |
You're right, that was my bad :) I upgraded and it still passed. |
@MatanBobi
in my project, which probably caused |
@li-yifei |
For me the issue was |
@testing-library/react
version: 10.4.6Relevant code or config:
What you did:
Tried to render the whole with some lazy loaded components which using hooks.
What happened:
It throws
error when I call query methods from the render result or
screen
.Reproduction:
There's a csb sample based on https://codesandbox.io/s/github/kentcdodds/react-testing-library-examples
https://codesandbox.io/s/throbbing-lake-op237?file=/src/lazy-component.js
Problem description:
Can't test high level componets including React.lazy children
Suggested solution:
The text was updated successfully, but these errors were encountered: