Cory House
Aug 22, 2017 · 1 min read

I noticed that the problem returns (it will re-render) if I simply re-write User as a function

Yes, that’s correct because by doing so it’s no longer declared as a pure component. If you want to avoid unnecessary renders when the parent component re-renders, you need to declare shouldComponentUpdate or declare PureComponent. You can’t do either on a functional component.

)

    Cory House

    Written by

    Pluralsight Author, Principal at reactjsconsulting.com, Software Architect, Microsoft MVP, Speaker, Clean Coder, Aspiring Outlier.