Skip to content
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 fix for Next.js #44

Merged
merged 1 commit into from
Feb 21, 2023
Merged

Hydration fix for Next.js #44

merged 1 commit into from
Feb 21, 2023

Conversation

doseofted
Copy link
Contributor

@doseofted doseofted commented Feb 10, 2023

Using Next.js, a hydration error is given when using the library. A part of the error:

Warning: Prop `style` did not match. Server: "position:absolute;z-index:9999;top:0;left:0;right:auto;bottom:auto;transform:translate(0px,0px)" Client: "position:absolute;z-index:9999;top:0;left:0;right:auto;bottom:auto;transform:translate(0px,0px);width:"
    at div
    at span
    at eval
...

The width style is now set to undefined so client hydration matches server. This resolves the error in Next.js.

Also, love the library! It has saved me a bunch of time setting up Headless UI / Floating UI.

@doseofted doseofted mentioned this pull request Feb 13, 2023
@doseofted doseofted marked this pull request as ready for review February 13, 2023 13:41
@ycs77 ycs77 mentioned this pull request Feb 17, 2023
19 tasks
@ycs77 ycs77 linked an issue Feb 21, 2023 that may be closed by this pull request
@ycs77 ycs77 merged commit 511a137 into ycs77:main Feb 21, 2023
@ycs77
Copy link
Owner

ycs77 commented Feb 21, 2023

@doseofted Thanks for the PR~

@ycs77
Copy link
Owner

ycs77 commented Mar 11, 2023

Released v0.11 contains this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR Issue in Next.js
2 participants