I write JavaScript only occasionally and I am not a JavaScript expert by any means, but I find classes useful. Can you tell me where this tendency comes from? Why there are large code bases without a single usage of the "class" keyword?
JS was intended as a scripting language. You didn't spend time crafting your types so that you could do large-scale projects (multiple developers and/or long time spans) that typing really helped. JS's classes didn't do enough to enable that, so JS was never really used for the types of business logic that is most effective for types.
Typescript does add that. But TS pushes towards a function-based development style. Classes add ways of organizing code to that, which is good, and TS makes it more useful. But TS still isn't much adopted to the large-scale projects that really make best use of it. You can use TS non-class Types and do almost as well without having to learn all the new syntax (and more importantly, semantics).
OO is oriented a lot around encapsulating mutable state, but development style really pushes these days around immutable state. It's just easier to debug and scale. (At a performance cost, but if performance is what you're after, you're not writing Javascript.) So function-based code is what you get.
On reactjs, the flow is much more smoother with hooks instead of class instances because there is no more need to bind functions to your class instances in your class constructor;
there is no need to refer to `this` (on hooks you work with vars directly), and on hooks you are forced to treat things immutably (when you are calling set_value(new_value) instead of mutating the class state directly;
and the useEffect hooks give you a better control and grip on the react component lifecycle.
I honestly avoid usage of es6 classes unless I have to extend another class (e.g. extending Error for custom errors, or extending nodejs EventEmitter).
[0] https://www.reddit.com/r/cpp/comments/262it3/effective_c_pre...