-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Add react-jss example #5140
Add react-jss example #5140
Conversation
@kof @oliviertassinari could you have a look at this example 🕵️ If it looks alright I'll merge it 👍 |
@HenriBeck How do you solve the hot reloading class name missmatch issue? On Material-UI we had to remove the moduleId. |
There aren't any mismatches when hot reloading. I can change the styles or a component, and I get the new changes applied. I think the reason it works, is because |
It's good to know. |
A mismatch should only happen when the client is being hydrated which only happens on the first render if I'm correct. The HMR should only rerender/update the components. |
@@ -0,0 +1,3 @@ | |||
{ | |||
"presets": ["next/babel"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unneeded 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get this error when I don't have this file:
Module build failed: Error: [BABEL] /Users/henri/Coding/next.js/examples/with-react-jss/pages/_app.js: You gave us a visitor for the node type PrivateName but it's not a valid type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You possibly have a .babelrc
in an upward directory 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh yeah that's fine. Users download only the example itself. Either way it'll work 👍
Added a clear example on how to use react-jss with injecting the styles on the server.
cssinjs/jss#457