PureRenderMixin
Note:
PureRenderMixin
is a legacy add-on. UseReact.PureComponent
instead.
Importing
Overview
If your React component's render function renders the same result given the same props and state, you can use this mixin for a performance boost in some cases.
Example:
Under the hood, the mixin implements shouldComponentUpdate, in which it compares the current props and state with the next ones and returns false
if the equalities pass.
Note:
Furthermore,
shouldComponentUpdate
skips updates for the whole component subtree. Make sure all the children components are also "pure".
Last updated
Was this helpful?