-
-
Notifications
You must be signed in to change notification settings - Fork 2k
refs are not triggered on root elements #1504
Copy link
Copy link
Closed
Description
Refs on the mounted root element do not appear to be triggered. Is this expected behaviour?
it('triggers refs on child elements', (done) => {
mount(<div><span ref={(c) => done()}/></div>);
});
it('triggers refs on root elements', (done) => {
mount(<span ref={(c) => done()}/>);
});
Current behavior
The child elements test passes, but the root element test fails
Expected behavior
Both tests should pass
API
- shallow
- mount
- render
Version
| library | version |
|---|---|
| Enzyme | 3.3.0 |
| React | 16.2.0 |
Adapter
- enzyme-adapter-react-16
- enzyme-adapter-react-15
- enzyme-adapter-react-15.4
- enzyme-adapter-react-14
- enzyme-adapter-react-13
- enzyme-adapter-react-helper
- others ( )
Reactions are currently unavailable