-
Notifications
You must be signed in to change notification settings - Fork 18
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
SSR hydration warning #17
Comments
This was referenced Jun 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, this module is great and we use it over at https://github.com/dayhaysoos/use-shopping-cart :) ❤️
We've had some folks run into this issue (dayhaysoos/use-shopping-cart#122) which seems to be a hydration warning because the server-side rendered value differs from the value on the client.
Have you seen that before by any chance? I did some digging, and the general recommendation is to use the same initial state as on the server, and then update it in a
useEffect
hook, but I'm not sure if that's possible within a custom hook 🤔Reproduction steps
I've set up an environment to reproduce: https://codesandbox.io/s/autumn-grass-vhu4e?expanddevtools=1&fontsize=14&hidenavigation=1&theme=dark
Console
tab (Second tab next toTerminal
in the bottom right dev tools)The text was updated successfully, but these errors were encountered: