JS does not have classical OOP built in! It has Brandon Eich's prototypal inheritance system (which has some key differences), along with a 2015 addition to the language to pretend it has OOP (but really that's just lipstick on the underlying prototypal pig).
If you use classes in JS, you're bound to be disappointed at some point when they don't behave like classical OOP. Most devs accept that and use more functional approaches (like factory functions) instead of OOP.
(disclaimer: FP all the way, regardless)
I think the intent is very similar even though there are some structural differences: move the state and state logic out of the view to classes.
mjfisher•48m ago
- Zustand exposes itself as a hook.
- MobX does that observer-wrapper thing
- Snapstate instead has an explicit writing step (`scoped()`) at the bottom of a component
If so, I really quite like that. Kudos!