I still think Class components provided an easier mental model for most developers compared to functional components. Hooks specially feel very error-prone by comparison.
I’ve been doing web development since 1997 so I feel like I can have a few opinions at this point.
Reacts insistence at the time on everyone should use hooks was hands down one of the dumbest things I’ve seen in all my time.
Not only was it on extremely shaky grounds technically but now you have huge swaths of developers have this extremely React specific mental model of building apps that translates poorly to almost everything else out there.
There is a reason why almost nobody else out there followed that trend. Classes are actually the ideal abstraction for building a component based on UI.
Whats going on here? I see it adds and removes a resize event listener… okay, when?What happens with the function it returns?
Why do I need to pass in an empty array? What could even go in there? What happens if I omit it (it is empty).
Where is the unmounting and mounting? What order do things happen in and when?
These have answers of course. The function runs according to the dependency array (prop, state, etc) and just on mount if empty. And the callback runs on unmount, if any. But you have to learn them. Before you do, it's magic. And when you step away, you have to re-learn it. And when it gets a bit more complicated, you're going to have to sit down and learn it better.