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

Enzyme still trigger a render when null is returned from setState #1643

Closed
2 tasks done
samouss opened this issue May 2, 2018 · 3 comments
Closed
2 tasks done

Enzyme still trigger a render when null is returned from setState #1643

samouss opened this issue May 2, 2018 · 3 comments

Comments

@samouss
Copy link

samouss commented May 2, 2018

Current behavior

Not sure if it's an issue or a non documented behaviour (or I didn't found it). With shallow when we return null from an updater function, React prevent the render. But Enzyme don't.

There is no issue with mount.

Expected behavior

Enzyme should prevent the render when we return null from an updater function.

Your environment

Here is an example.

API

  • shallow

Version

library version
Enzyme ^3.3.0
React ^16.3.2

Adapter

  • enzyme-adapter-react-16
@koba04
Copy link
Contributor

koba04 commented May 7, 2018

I think this is an issue of React so I've created a PR to fix this. facebook/react#12756

@koba04
Copy link
Contributor

koba04 commented May 8, 2018

Fixed by facebook/react#12756

@samouss
Copy link
Author

samouss commented May 8, 2018

Thanks!

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