4 ms·
We have a few rather complex mixins in React-Router-Component and react-mixin's decorators worked just fine [1]. The only limitation I see now is a mixin that d
by STRML 11y ago
We have a few rather complex mixins in React-Router-Component and react-mixin's decorators worked just fine [1]. The only limitation I see now is a mixin that defines more mixins; this currently doesn't work, but there's no reason why it couldn't. I am considering a patch.
1. https://github.com/STRML/react-router-component/blob/master/examples/es6/app.js#L11 https://github.com/STRML/react-router-component/blob/master/...
- egeozcan 11y agoThank you for the heads up and the example. > The only limitation I see now is a mixin that defines more mixins; this currently doesn't work Why and how would you do this?
- STRML 11y agoIt's just a nice way to split up concerns. In React-Router-Component, the RouterMixin [1] mixes in the Environment Mixin [2] which allows the Environment to address its own concerns in a separate file and to be included in other, custom components. 1. https://github.com/STRML/react-router-component/blob/master/lib/RouterMixin.js#L9 https://github.com/STRML/react-router-component/blob/master/... 2. https://github.com/STRML/react-router-component/blob/master/lib/environment/index.js#L12 https://github.com/STRML/react-router-component/blob/master/...
- egeozcan 11y agoAh, now I get it, you meant nested mixins. Great, thanks for the pull, hope it gets merged.
- STRML 11y agoI've submitted a fix for this in react-mixin here. https://github.com/brigand/react-mixin/pull/22 https://github.com/brigand/react-mixin/pull/22