Update React.PureComponent reference.

Rewording the `React.PureComponent` reference to make it more clear, that `React.Component` doesn't implement `.shouldComponentUpdate` at all.
This commit is contained in:
Szymon Nowicki
2017-12-16 12:25:31 +01:00
committed by GitHub
parent 04f46c4c5d
commit 74d974449c

View File

@@ -70,8 +70,7 @@ See the [React.Component API Reference](/docs/react-component.html) for a list o
* * *
### `React.PureComponent`
`React.PureComponent` is exactly like [`React.Component`](#reactcomponent), but implements [`shouldComponentUpdate()`](/docs/react-component.html#shouldcomponentupdate) with a shallow prop and state comparison, which [`React.Component`](#reactcomponent) is missing completely.
`React.PureComponent` is similar to [`React.Component`](#reactcomponent). The difference between them is that [`React.Component`](#reactcomponent) doesn't implement [`shouldComponentUpdate()`](/docs/react-component.html#shouldcomponentupdate), but `React.PureComponent` implements it with a shallow prop and state comparison.
If your React component's `render()` function renders the same result given the same props and state, you can use `React.PureComponent` for a performance boost in some cases.