Skip to content

Guard setState so that it is not called when the container is already unmounted#8

Open
leonid-shevtsov wants to merge 1 commit into
masterfrom
bug/setstate-when-unmounted
Open

Guard setState so that it is not called when the container is already unmounted#8
leonid-shevtsov wants to merge 1 commit into
masterfrom
bug/setstate-when-unmounted

Conversation

@leonid-shevtsov

Copy link
Copy Markdown

This is mostly done to silence a warning in React:

Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component CalculatorContainer. This is a no-op.

See discussion at react/react#2787

As this issue is unresolved and there is no final opinion from React devs, I think it's prudent to add a guard for the time being.

@leonid-shevtsov

Copy link
Copy Markdown
Author

cc @XeeD @mikekreeki

@XeeD

XeeD commented Jul 3, 2015

Copy link
Copy Markdown

👍

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

Successfully merging this pull request may close these issues.

3 participants