isMounted

isMounted

boolean isMounted()

isMounted() returns true if the component is rendered into the DOM, false otherwise. You can use this method to guard asynchronous calls to setState() or forceUpdate().

This method is not available on ES6 class components that extend React.Component. It will likely be removed entirely in a future version of React, so you might as well start migrating away from isMounted() now.

doc_React
2016-06-23 03:32:03
Comments
Leave a Comment

Please login to continue.