Using Pure Components
Pure Components do shallow equality checks in shouldComponentUpdate
by default. This is intended to prevent renders when neither props nor state have changed.
Recompose offers a Higher Order Component called pure
for this purpose and React added React.PureComponent
in v15.3.0.
The bad way
The good way
A better way
Related links:
Last updated
Was this helpful?