I think it made using classes more popular before hooks, and drove--along with functional components--the more general popularity of functional style of js afterwards. I feel like the latter are the idioms you will find most common in modern code, docs, and training today; though class components are still fully supported.
moritzwarhier|2 years ago
The machinery behind the scenes might be ugly, but this syntax is also what I love about React Hooks.
I was preferring closures to ES6 classes before using React, despite the performance implications.
Since switching to TypeScript I also like ES classes though.
Especially for things like MobX... but even without it.
Regardless of React, I feel like classes are the context where getters and setters feel most natural and ergonomic.
And classes are great for grouping state and behavior in an easy-to-understand way.
nurple|2 years ago