Open hburrows opened 6 years ago
@hburrows have you tried latest versions, do we still have collisions?
@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?
We added instance id, which should avoid collisions between instances, try it.
On Jan 22, 2018 03:23, "Howard Burrows" notifications@github.com wrote:
@kof https://github.com/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?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cssinjs/styled-jss/issues/60#issuecomment-359307796, or mute the thread https://github.com/notifications/unsubscribe-auth/AADOWFXn2L--NIpd02KeD9Z2fq1JrUL4ks5tM_ENgaJpZM4Qkjs9 .
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.