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

setState() callback #5

Open
GravityMsc opened this issue Jan 23, 2018 · 0 comments
Open

setState() callback #5

GravityMsc opened this issue Jan 23, 2018 · 0 comments

Comments

@GravityMsc
Copy link
Owner

GravityMsc commented Jan 23, 2018

In this issue, facebook/react#6320

setState callback fires after changes have been flushed to the DOM. Since they were never flushed, it was never called.

and it seems be true

The second (optional) parameter is a callback function that will be executed once setState is completed, even if the component is not re-rendered (e.g. when shouldComponentUpdate() returns false). However, if the component is unmounted before the callback is called, it won't be called later anymore. You can handle such situations in the componentWillUnmount() method.

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