-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with react-jss #10
Comments
It's my understanding that this library was made with material-ui in mind - ideally it should be used instead of react-jss because it would probably lead to duplicate stylesheets. One example of usage is in the 'next' branch for MUI |
cssinjs/jss#356 |
@reohjs Can you elaborate ? This is just about optimization ? |
@NitroBAY React-jss and theme-reactor essentially do the same thing - render and manage jss sheets - so using both is redundant. Their APIs are also incompatible since theme-reactor creates, registers and attaches the stylesheet in one go, meaning you can't use react-jss to manage them as it only accepts a css rules object or StyleSheet instance (and not a function or callback). React-jss also doesn't provide any hooks to update ALL of your stylesheets when you change theme, so if you wanted to use react-jss, you would have to make your own theme management system Theme-reactor uses an inline approach:
while react-jss wraps components via |
Okay so theme-reactor is React-jss + no need to use curried functions because instead of this you're naming the stylesheet, theme-reactor use one |
Maybe it's not documented but what's cool with material-ui and this package is that they both have clean proper es6 code. You don't go full mad by trying to get what code is supposed to do +1 |
Yep, but they both keep stylesheets separate & use multiple |
I'm new to jss and, given comments by @reohjs above, I'm confused as to why the docs for jss-theme-reactor have a (broken) link for "React integration". If I want to use jss with my react components and make them themeable, should I be using jss-theme-reactor AND react-jss? Or only one of them and, if so, which? |
Hello sentences as
Seems to point out that ya should use it either this package or react-jss |
Hello! I am new to jss. Can you help me?
What you suggest if i want to make this lib friend with react-jss?
As i can see from the documentation createStyleSheet() returns style manager not the actual styles object which react-jss expects.
The text was updated successfully, but these errors were encountered: