|
|
|
|
|
by lukasm
3995 days ago
|
|
You have 3 options if you want mixin behaviour: - Use old syntax or explicitly add mixin to prototype
- Use composition. A bit annoying, because you have to make an extra class class OuterComponent extends React.Component {
render() {
return (
<MixinComponent>
<InnerComponent />
</MixinComponent>
);
}
}
class InnerComponent extends React.Component{}
- wait for decorators (?) |
|
[1] https://babeljs.io/docs/usage/experimental
[2] http://raganwald.com/2015/06/26/decorators-in-es7.html