Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Components (2018) React Component Patterns Optimize Performance with PureComponent

Miroslav Kovac
Miroslav Kovac
11,454 Points

Functional, class Component or class PureComponent

Hello to all, if I understand it good until now, is good practice to use stateless functional components when is it possible - and get the data there only via 'props'.

But now, after this video seems so, that is better to use PureComponent (without state) instead of functional components....becauase there is automatic control if the component should update or not.....I am right? If PureComponent not helps, I should use Component with own implementation of 'shouldComponentUpdate()'

What is the workflow then of developing a real React-application, should I always check if the component is re-rendered also when it should not be? Cannot it be very workly when the project grows in time?

I only want to ask about standards....

Thanks for any hints