-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Using React 16 createRef #1704
Comments
(I wouldn't recommend using As for the refs, enzyme doesn't quite support that yet, but it's coming! |
Thanks @ljharb for the info, feel free to close this if you are tracking elsewhere. |
I have the same problem. I've updated React to 16.4 and used React.createRef() and got an error in my tests. Error:
Cause of this.tableHead = React.createRef(); |
The I'm not sure there's anything actionable here. As to @PetrivskyiTaras' issue, shallow rendering can't support refs, only |
I'm trying to reference new React 16 refs in my enzyme 3 tests so that I can call .simulate, etc on internal references.
Simplified example:
Test:
However I get errors like:
TypeError: component.instance(...).textInput.current.simulate is not a function
This is a simplified example so I'm not looking for alternate ways of finding the input - I'm curious if and how we can use and test using React 16 references?
The text was updated successfully, but these errors were encountered: