3 ms·
This is not limited to ES6+, class/inherits/super are syntactic sugar for existing prototypical OOP idioms.
by oinksoft 11y ago
This is not limited to ES6+, class/inherits/super are syntactic sugar for existing prototypical OOP idioms.
- coldtea 11y agoIt's not limited to ES6, but it's not needed with the ES5 way of declaring React components, as mixins are supported there.
- oinksoft 11y agoActually you don't need to use React.createClass to use mixins, there is https://www.npmjs.com/package/react-mixin https://www.npmjs.com/package/react-mixin which implements them via decorators. Either I wouldn't consider inheritance and mixins interchangeable.