You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving discussion from react-jss..... I've been using both react-jss and styled-jss in the same app. This has worked fine until upgrading to the most recent versions of jss, react-jss, and styled-jss. Everything works fine during development but when I bundle my app with NODE_ENV=production I end of with duplicate className conflicts.
After some investigation I concluded that styled-jss does not honor anything in context put there by react-jss's JssProvider. Most of my styled-jss use is in a separate, sharable package. styled-jss does not declare react-jss as a dependency so I"m not sure this is technically a bug. However, my expectation was that they'd work together -- especially since they both target react apps. More importantly.... for the benefit of the jss ecosystem... and getting stuff to "just work" I wonder if styled-jss should honor what JssProvider puts there and I guess make react-jss and dependency?
I'm going to explore a "custom JSS" setup and try to share a className generator between the 2... but this seems like a lot of friction for 2 packages that I would expect to work well together. Curious what your thoughts are ?
@kof mentioned "Initially they were not meant to be be used together, but I think in theory they should do so if they turn out to be complementary. I think we are not aware right now of complementarity." They're a different approach to styling your app. I tend to use styled-jss for structural components (flexbox layouts and stuff like that) and react-jss for more component centric styling. It's arguable whether that's complimentary or not... but I'm struggling to understand why they wouldn't be designed to work well together so it's up to the end-user to decide when to use which. Since they're part of the same cssinjs org and both target React apps my expectation was that they'd work together.
The text was updated successfully, but these errors were encountered:
@kof I configure createStyled and JssProvider to use the same className generator and that solves the issue. Would the latest versions solve that without the custom className generator?
Moving discussion from
react-jss
..... I've been using bothreact-jss
andstyled-jss
in the same app. This has worked fine until upgrading to the most recent versions ofjss
,react-jss
, andstyled-jss
. Everything works fine during development but when I bundle my app withNODE_ENV=production
I end of with duplicate className conflicts.After some investigation I concluded that
styled-jss
does not honor anything in context put there byreact-jss
'sJssProvider
. Most of mystyled-jss
use is in a separate, sharable package.styled-jss
does not declarereact-jss
as a dependency so I"m not sure this is technically a bug. However, my expectation was that they'd work together -- especially since they both target react apps. More importantly.... for the benefit of thejss
ecosystem... and getting stuff to "just work" I wonder ifstyled-jss
should honor whatJssProvider
puts there and I guess makereact-jss
and dependency?I'm going to explore a "custom JSS" setup and try to share a className generator between the 2... but this seems like a lot of friction for 2 packages that I would expect to work well together. Curious what your thoughts are ?
@kof mentioned "Initially they were not meant to be be used together, but I think in theory they should do so if they turn out to be complementary. I think we are not aware right now of complementarity." They're a different approach to styling your app. I tend to use
styled-jss
for structural components (flexbox layouts and stuff like that) andreact-jss
for more component centric styling. It's arguable whether that's complimentary or not... but I'm struggling to understand why they wouldn't be designed to work well together so it's up to the end-user to decide when to use which. Since they're part of the samecssinjs
org and both target React apps my expectation was that they'd work together.The text was updated successfully, but these errors were encountered: