-
Notifications
You must be signed in to change notification settings - Fork 231
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
Hydration failed for server rendered code #271
Comments
Thanks for submitting an issue @pekarja5!
|
pekarja5
added a commit
to pekarja5/react-slider
that referenced
this issue
Aug 23, 2022
@kris-ellery Any chance to have #272 merged to fix the issue? |
@pekarja5 thank you for contributing! Released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Hydration fails with:
Prop `style` did not match. Server: "position:absolute;left:0;right:0" Client: "position:absolute;will-change:;left:0;right:0"
Server is running Next.js 12.0.5 with React 18 on Node 16 LTS.
The problem is caused by different style resolve for empty strings (server won't include them, but client does) resulting in hydration fail.
Using
undefined
instead of empty strings should unify the results (key should not be present on both - client and sever).Operations like this are causing the issue: https://github.com/zillow/react-slider/blob/master/src/components/ReactSlider/ReactSlider.jsx#L977
The text was updated successfully, but these errors were encountered: