-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Jss server side render with custom createGenerateClassName #704
Comments
it can only mean that you are not rerendering your component on the server on each request, I guess you have some sort of caching, but without actually seing the code I am useless. |
@kof I tried to make the scenario here, not exactly but I can only get the counter log for the very first time of render function, in the following renders counter logging does not appear. Could you help me take a look? |
Hmm, needs further investigation, I also tried https://codesandbox.io/s/6jmrxkw50r Seems like something is caching but its not clear what, might be a bug! |
@up209d do you want to dig into it? |
@kof Yeah, I shall spend time looking into the src code. Since I used react-jss, I am not sure where is the source of that caching, could be inside jss core or react-jss itself. I shall report soon when I figure out the spot. |
It looks like https://codesandbox.io/s/9zr309968o It is something to do with |
I got it, turned out JssProvider.js
If |
I used createGenerateClassName on both Client Side and Server Side
By my expectation, every request ( browser refreshes ) it should log all the counter which were made. That is true by client side but not server side, I got full of the counter log for the very first request then after refreshing browser for following requests, client-side got full log every time meanwhile server-side got no counter log at all. That's so weird as a result, for every route change and after a refresh, I ended up with
Warning: Prop
classNamedid not match...
I am using:
"react": "^16.2.0",
"react-jss": "8.4.0"
"jss": "9.8.1"
The text was updated successfully, but these errors were encountered: