mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Merge pull request #433 from sznowicki/patch-1
Update `React.PureComponent` reference.
This commit is contained in:
@@ -71,7 +71,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.
|
||||
`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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user