--

The idea that you can choose without concern goes against everything the React Team says.

Class components are supported because they don’t want to break their ecosystem, but they’re not recommended under any circumstances other than creating error boundaries. And that’s just because they haven’t ported that yet.

The question isn’t “Which should you use?” The answer is functional components. The question is “Should I refactor my class components into functions?” And the answer is, you don’t have to, they’ll be supported for a long time, if not always.

But to suggest that class components are a viable direction for new development robs developers of the ability to take advantage of improvements to the component paradigm, because they aren’t backporting to classes.

--

--

Michael Landis
Michael Landis

Written by Michael Landis

Front-end web developer, React enthusiast, vagabond.

Responses (2)