javascript - Set ReactJS state asynchronously -


If you perform an asynchronous action which converts state to componentWillMount (such as Docs ), But that component has been unmounted (user has navigated) before the async call is complete, now you are trying to set the state with unmountable callback on unmounted components, and one

"Invoire violation: Replacement (...): Only a mount or mounting component The date can. "

error.

What's the best way around this?

Thank you.

Update 2016

isMounted < Do not start using / code> because it will be removed from the response.

Perhaps the best solution for problems arising from the async call from cmomponentWillMount is to move things to componentDidMount .

How to solve this problem properly and how to use not is mounted here:


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -