0 votes
in ReactJS by
What are Pure Components?

1 Answer

0 votes
by
React.PureComponent is exactly the same as React.Component except that it handles the shouldComponentUpdate() method for you. When props or state changes, PureComponent will do a shallow comparison on both props and state. Component on the other hand won't compare current props and state to next out of the box. Thus, the component will re-render by default whenever shouldComponentUpdate is called.

Related questions

0 votes
asked Apr 14, 2021 in ReactJS by SakshiSharma
0 votes
asked Jan 31, 2021 in ReactJS by Robindeniel
...