dillon1000/react

Commit

Add `ReactComponent#isMounted`

There is currently no way for components to know whether or not they are mounted. This means there's no way for callbacks to figure out if they can make certain assumptions (e.g. can `getDOMNode()` or `setState()` be safely invoked).

This adds an `isMounted` protected method that lets components properly handle callback behavior when unmounted.
Browse files
Changed paths3 files
First-parent comparison
M src/core/ReactComponent.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/core/__tests__/ReactNativeComponent-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…