We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In react, Refs for node elements are the underlying DOM HTMLElement, Refs for Components are the Component instance.
When using Enzyme and mounting an html node element, the ref is not an HTMLElement
The expected behaviour is to be on par with React, it shouldn't behave differently, the ref should be the element itself.
Node 12.4 Mac OSx Sierra
mount(<div ref={(el) => { console.log(el); el.removeEventListener('click'); // exception, not a function }} > </div>);
The text was updated successfully, but these errors were encountered:
[enzyme-adapter-react-*, enzyme-adapter-utils] [fix] mount: ensure …
mount
a5319e4
…the root’s `ref` prop gets attached to the actual root Fixes enzymejs#2253.
0ccee2f
…the root’s `ref` prop gets attached to the actual root Fixes #2253.
ref
7836e57
ljharb
Successfully merging a pull request may close this issue.
Current behavior
In react,
Refs for node elements are the underlying DOM HTMLElement,
Refs for Components are the Component instance.
When using Enzyme and mounting an html node element, the ref is not an HTMLElement
Expected behavior
The expected behaviour is to be on par with React, it shouldn't behave differently, the ref should be the element itself.
Your environment
Node 12.4
Mac OSx Sierra
API
Version
Adapter
The text was updated successfully, but these errors were encountered: