cssinjs / theming

Unified CSSinJS theming solution for React
300 stars 39 forks source link

Optional props renaming? #47

Open w9 opened 6 years ago

w9 commented 6 years ago

In existing projects there might be components that already has the theme prop. Also, sometimes a component only cares about parts of the theme. Maybe provide an option to send in a mapping function just like how connect in react-redux works?

withTheme(theme => {theTheme: theme})(Component)
withTheme(theme => {primaryColor: theme.palette.primary})(Component)
kof commented 6 years ago

That seems reasonable for theming package. Not sure though how to integrate that into react-jss. I assume you are using theming directly?