-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Support getSnapshotBeforeUpdate for shallow #1602
Copy link
Copy link
Closed
Description
Current behavior
React v16.3.0 introduced new lifecycle method called getSnapshotBeforeUpdate.
the method isn't supported by ShallowRenderer so we have to add support the method on enzyme if needed.
The method is called at the same timing with componentWillUpdate so we might need some hacks ShallowRenderer internals.
In addition to that, the arguments of componentDidUpdate have been changed, which accepts snapshot as the 3rd argument.
https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html
Should enzyme support this method?
If so, I'd like to work on based on #1192
Expected behavior
Your environment
API
- shallow
- mount
- render
Version
| library | version |
|---|---|
| Enzyme | 3.3.0 |
| React | 16.3.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