DEV Community

Discussion on: React Beginner Question Thread ⚛

Collapse
 
mike_gichia profile image
Michael Gichia

Dan, please clarify on the use cases of PureComponent other than stateless components. My understanding of PureComponent is that if misused, will slow down the application rather than making it faster. Since PureComponent will diff the changes before rerender.

Collapse
 
dan_abramov profile image
Dan Abramov

Use PureComponent when you have performance issues and have determined that a specific component was re-rendering too often, but its props and/or state are shallowly equal.

reactjs.org/docs/optimizing-perfor...

Thread Thread
 
michaelgichia profile image
Michael Gichia

Thank you for the clarification Dan.