News for hackers. Stuff that matters.
Re:React on ES6+ by shangxiao on Wednesday July 08, 2015 @04:19AM (#9850410)
Not yet supported afaik [1]. I've used react-mixin [2] with some success.

[1] https://facebook.github.io/react/blog/2015/01/27/react-v0.13...

[2] https://github.com/brigand/react-mixin

Re:React on ES6+ by egeozcan on Wednesday July 08, 2015 @05:28AM (#9850644)
Looks like a great idea, a nice intermediate step while the decorators are not widely used. I wonder what didn't work out as you said "some success"?
Re:React on ES6+ by STRML on Wednesday July 08, 2015 @12:54PM (#9852968)
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/...

Re:React on ES6+ by egeozcan on Wednesday July 08, 2015 @01:01PM (#9853025)
Thank 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?

Re:React on ES6+ by STRML on Wednesday July 08, 2015 @01:58PM (#9853495)
It'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/... 2. https://github.com/STRML/react-router-component/blob/master/...

Re:React on ES6+ by egeozcan on Wednesday July 08, 2015 @03:22PM (#9854020)
Ah, now I get it, you meant nested mixins. Great, thanks for the pull, hope it gets merged.
Re:React on ES6+ by STRML on Wednesday July 08, 2015 @03:06PM (#9853930)
I've submitted a fix for this in react-mixin here. https://github.com/brigand/react-mixin/pull/22