Skip to content

Commit

Permalink
Document isMounted
Browse files Browse the repository at this point in the history
Text from @petehunt
  • Loading branch information
vjeux committed Jan 16, 2014
1 parent 89819de commit 2562813
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/docs/ref-02-component-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.

0 comments on commit 2562813

Please sign in to comment.