From b276112ef0c86b61c855bffa13897c65dfff755b Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 16 Jan 2014 10:08:53 -0800 Subject: [PATCH] Document isMounted Text from @petehunt --- docs/ref-02-component-api.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/ref-02-component-api.md b/docs/ref-02-component-api.md index d3e3ba16..28b6ae96 100644 --- a/docs/ref-02-component-api.md +++ b/docs/ref-02-component-api.md @@ -107,3 +107,12 @@ If your `render()` method reads from something other than `this.props` or `this. 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. 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. + + +### isMounted() + +```javascript +bool 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()`.