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

Further explanation about why side-effects should be limited to useEffect #2607

Open
HunderlineK opened this issue Dec 12, 2019 · 0 comments

Comments

@HunderlineK
Copy link

HunderlineK commented Dec 12, 2019

There are multiple recommendations about when side-effects are okay and when they are not okay; it is difficult to memorize them all, so it would be helpful if some further explanation is added explaining exactly why useEffect should be exclusively used for side effects e.g.
https://github.com/reactjs/reactjs.org/blob/master/content/docs/hooks-effect.md#example-using-classes-example-using-classes

For traditional life-cycle hooks, the reasoning is that some of them might be called multiple times before the render is committed; is the same applicable to hooks?

Thanks!

p.s. This comment seems relevant:
#302 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant