This repository has been archived by the owner on Oct 19, 2018. It is now read-only.
need to make sure observer has not been deleted before doing a delayed update #6
Labels
Milestone
SetState is generally delayed to the end of the rendering cycle, and all updates are sorted and queued to prevent multiple updates of the same value.
If component A gets a state update during this delayed update process, and that causes another component to unmount, and that component is scheduled to receive state updates, react.js generates a warning (because you will attempt to do a state update on an unmounted component.)
The fix is to simply check to see if the observer has been removed from the
current_observers
list.The above code will work as a patch if you want to try it.
The text was updated successfully, but these errors were encountered: