Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Mixins vs. composition? #65

Closed
dlmanning opened this issue Mar 4, 2015 · 4 comments
Closed

Mixins vs. composition? #65

dlmanning opened this issue Mar 4, 2015 · 4 comments

Comments

@dlmanning
Copy link

I was wondering if there are any plans for making this library work with ES6 classes without requiring the use of mixins? It isn't a huge deal since the React team has been pretty explicit that React.createClass isn't going anywhere, but it would be nice not to have to find a way to use mixins just to use radium.

This thread discusses the possible evolution of React apart from mixins: facebook/react#1380

Here's an example from @sebmarkbage of one way to accomplish a similar effect compositionally: https://gist.github.com/sebmarkbage/fac0830dbb13ccbff596

Seems like maybe something like this could work for radium, or possibly be exposed as an alternative to standard mixins? Anyone have thoughts?

@alexlande
Copy link
Contributor

We haven't made any specific plans for this, but it's something we want to do. React is moving away from the current mixin system, and I personally want to start using ES6 classes, so there's plenty of motivation.

I've been following the discussion around mixins + alternatives very loosely, but hadn't seen that gist. Looks like a good direction to explore.

I think I'd prefer to keep mixins around for people who want to keep using createClass, but allowing users to choose which approach they want to take makes perfect sense to me.

@tcoopman
Copy link

tcoopman commented Apr 1, 2015

Is this something you have made progress on, or are working on?

@alexlande
Copy link
Contributor

We've got a new Higher Order Component-- Radium.Enhancer, shipping in Radium 0.12. With that, Radium is fully ES6 class compatible.

@dlmanning
Copy link
Author

woot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants