Components that render with change in Reactjs

Components re-renders when the parent render. Sometimes we may not need all the components get re rendered every time. As the program expanding these render can make some performance degrade.

PureComponent is a class component features. Functional component miss this feature.

So think about component that aware of the content, of course React has such One. A component extended from class PureComponent is called pure component.

class PureComp extends PureComponent {
   render() {
       console.log('*********Pure render*********');
       return (
              Pure Component {}
export default PureComp

The class also implement shouldComponentUpdate lifecycle by perform shallow comparison on props and state.

The pure component only render when props name has changed. This is like someone keep tracking the changes for you.

I am really excited about this React feature

Published by


A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.