Skip to content
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

Support getSnapshotBeforeUpdate for shallow #1602

Closed
2 of 10 tasks
koba04 opened this issue Mar 31, 2018 · 1 comment
Closed
2 of 10 tasks

Support getSnapshotBeforeUpdate for shallow #1602

koba04 opened this issue Mar 31, 2018 · 1 comment

Comments

@koba04
Copy link
Contributor

koba04 commented Mar 31, 2018

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 ( )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants