cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.06k stars 397 forks source link

Allow createUseStyles to access theme without useTheme explicitly #1418

Open just-Bri opened 3 years ago

just-Bri commented 3 years ago

Related to: https://github.com/cssinjs/jss/issues/1401

I thought this was working as intended until I stumbled upon the issue linked above. I actually like being able to basically auto-subscribe to the theme within children, rather than having to call useTheme() and pass the theme explicitly.

As @kof mentioned this could be turned in to an option on the ThemeProvider:

<ThemeProvider theme={theme} useTheme={true}/>
SuselMan commented 5 months ago

Hi, any updates here?

just-Bri commented 5 months ago

Hi, any updates here?

https://github.com/cssinjs/jss/commit/20e4e60ffd277e5a619e24d7c946b961a645d7bf