DEV Community

Discussion on: How React components work?

Collapse
 
fromaline profile image
Nick

Yep, I agree with you for the most part.

Functional components are much cleaner, and I prefer them over class-based ones. The same goes for other developers I know in person.

But at the same time, there is no official recommendation to avoid class-based components. For example, people with a strong OOP "background" would probably prefer class-based components. Because they at least partially follow the OOP paradigm.

Thanks for adding value to the conversation!

Collapse
 
virajsingh19 profile image
Viraj Singh

I've seen many codebases using hooks most of the time and a top level Class component for Error boundary, as there's no official error boundary hook available.