Using ES6 class for stateful vs pure functional components

While building UI with React components, composing the views with more stateless functional components can make the frontend code manageable, clean, and easier to test. But some components will need the state or lifecycle hooks to be more than pure presentational components. In this section, we look at what it takes to build stateful and stateless functional React components, when to use one or the other and how often.

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.