Closed HenriBeck closed 5 years ago
@kof and I decided that we will implement this feature by simply only passing the theme down to the component when it's inside the `inject´ sheet. We will subscribe to the theme when the styles are themed, or the theme is explicitly passed down.
@HenriBeck means when "inject" option contains "theme": e.g. injectSheet(styles, {inject: ['classes', 'theme']})
.
Also we discussed that we should turn off theme passing to the child component by default. I couldn't recall why I decided to pass the theme by default to the child anyways. If we find that out we could rethink. Right now I don't know why child component needs to be aware of the theme over props without explicitly asking for that.
Implemented in #934
Is your feature request related to a problem? Please describe. Get the theme as a prop even if the styles aren't themed.
Describe the solution you'd like We either allow for an option like
withTheme
or always subscribe to theme updates and pass the theme, though this solution would require some investigation if it creates performance issues.Initially created in cssinjs/react-jss#291