0
What are Pure Components in React js1?

Open 1 Answers 4 Views Education
What are Pure Components in React js1?

1 Answer

0

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.

by (280k points)
...