@samitouri / QOS-React-2 / commits / 8d29520dc7

clarifies forceUpdate method

Bob Ralian committed Feb 23, 2015 at 10:34 UTC 8d29520dc790200758dec67908a65dffc309553c
1 file changed +1 -1
docs/docs/ref-02-component-api.md
+1 -1
@@ -47,7 +47,7 @@ forceUpdate([function callback])
47
48 If your `render()` method reads from something other than `this.props` or `this.state`, you'll need to tell React when it needs to re-run `render()` by calling `forceUpdate()`. You'll also need to call `forceUpdate()` if you mutate `this.state` directly.
49
50 -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.
50 +Calling `forceUpdate()` will cause `render()` to be called on the component, skipping `shouldComponentUpdate()`. This will trigger the normal lifecycle methods for child components, including the `shouldComponentUpdate()` method of each child. React will still only update the DOM if the markup changes.
51
52 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.
53