React PureComponent

What is a PureComponent?

Why do we need it?

When and where should it be used?

PureComponent

A pure component in react is any functional/class component that return same output for same set of input params.

Why do we need a PureComponent?

The major reason to use a PureComponent is performance optimization.

Clean code

When and where should it be used?

Components with minimal data to render

Component VS PureComponent

The only difference is: PureComponent implements shouldComponentUpdate by default.

React PureComponent

By shahnawaz19415

React PureComponent

  • 134