[Docs] Replace 'mix in' in PureComponent notes (#8730)

* [Docs] Replace 'mix in' in PureComponent notes

* Style nit

(cherry picked from commit c3ce14a373)
This commit is contained in:
Spen Taylor
2017-01-12 16:02:47 +00:00
committed by Dan Abramov
parent fe20276c43
commit 7afcf8fab0
+1 -1
View File
@@ -106,7 +106,7 @@ If your React component's `render()` function renders the same result given the
> Note
> `React.PureComponent`'s `shouldComponentUpdate()` only shallowly compares the objects. If these contain complex data structures, it may produce false-negatives for deeper differences. Only mix into components which have simple props and state, or use [`forceUpdate()`](/react/docs/react-component.html#forceupdate) when you know deep data structures have changed. Or, consider using [immutable objects](https://facebook.github.io/immutable-js/) to facilitate fast comparisons of nested data.
> `React.PureComponent`'s `shouldComponentUpdate()` only shallowly compares the objects. If these contain complex data structures, it may produce false-negatives for deeper differences. Only extend `PureComponent` when you expect to have simple props and state, or use [`forceUpdate()`](/react/docs/react-component.html#forceupdate) when you know deep data structures have changed. Or, consider using [immutable objects](https://facebook.github.io/immutable-js/) to facilitate fast comparisons of nested data.
>
> Furthermore, `React.PureComponent`'s `shouldComponentUpdate()` skips prop updates for the whole component subtree. Make sure all the children components are also "pure".