Document isMounted
Text from @petehunt
Christopher Chedeau committed
Jan 16, 2014 at 10:08 UTC
2562813c63814bcdd52c90c9a36e796f2b33088e
1 file changed
+9
docs/docs/ref-02-component-api.md
+9
@@ -107,3 +107,12 @@ If your `render()` method reads from something other than `this.props` or `this.
107
Calling `forceUpdate()` will cause `render()` to be called on the component and its children, but React will still only update the DOM if the markup changes.
108
109
Normally you should try to avoid all uses of `forceUpdate()` and only read from `this.props` and `this.state` in `render()`. This makes your application much simpler and more efficient.
110
+
111
+
112
+### isMounted()
113
+
114
+```javascript
115
+bool isMounted()
116
+```
117
+
118
+`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()`.