-
Notifications
You must be signed in to change notification settings - Fork 21
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
Ability to disable SSR via prop #55
Comments
Hi, I have a project which used this feature and I thought I would share my workaround in case anyone finds it useful. Previously, my project (using ReactJS and Redux) was using v1.0.6 and the Frontload component was passed a boolean: noServerRender={noSsr} I traced the problem to: src/index.tsx:406
This sets serverRendered to true if this is the first render. That seems like a bug to me but may be correct in other situations.
Then instead of:
You can use:
One thing to note is that state.isFirstRender returns false unless state.serverRender.pass is greater than -1. That's technically the wrong way round. It should return false if a serverRender is detected. It's possible, in future src/index.tsx:406 becomes:
At which point, I would need to change createClientFrontloadState so state.isFirstRender returns the opposite. I hope that helps someone. |
In v1 version of this library there was a prop to disable SSR. It was very useful to me. Is it possible to add it again or can you suggest some other quick and convenient workaround?
The text was updated successfully, but these errors were encountered: