4 ms·
Personally I don't see why I would go back to using classes. IMHO, classic OOP doesn't fit to modern JS. I guess it's good to have the option though.
by antouank 12y ago
Personally I don't see why I would go back to using classes. IMHO, classic OOP doesn't fit to modern JS.
I guess it's good to have the option though.
- rattray 12y ago"Modern" JS simply didn't have classes, so classic OOP couldn't fit. People still tried a million different hacky ways though (eg; `React.createClass`). I'm disappointed with the implementation in this case (no mixins??) but the idea of going to classes now that we finally can makes sense.
- deleted 12y ago[deleted]
- danabramov 12y ago>I'm disappointed with the implementation in this case (no mixins??) The point is moving mixin handling to userland (and eventually some sort of standard?), if I understand correctly. It's not really React's concern. See also: Minimal API Surface Area http://www.youtube.com/watch?v=4anAwXYqLG8 http://www.youtube.com/watch?v=4anAwXYqLG8
- dan15 12y ago> IMHO, classic OOP doesn't fit to modern JS. ES6 classes aren't "classic OOP", they're syntax sugar for regular prototypal inheritance that JavaScript has had forever.