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

docs(dark-mode): #4927 Remove step & address hydration warning #5774

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blkhurst
Copy link

@blkhurst blkhurst commented Nov 8, 2024

Summary

  1. Remove Custom ThemeProvider:
    The next-themes library supplies ThemeProvider as a client component, making a custom wrapper unnecessary. This aligns the docs with the next-themes recommendations.

  2. Highlight Hydration Warning:
    The issue states a hydration error occurs when following the steps. I attempted to replicate, and believe highlighting the importance of adding suppressHydrationWarning to the <html> tag is the key to prevent this error, as stated here:

Note! If you do not add suppressHydrationWarning to your you will get warnings because next-themes updates that element. This property only applies one level deep, so it won't block hydration warnings on other elements.

Closes #4927

Copy link

vercel bot commented Nov 8, 2024

@blkhurst is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

ThemeProvider can now be imported from next-themes directly as a child component.
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.

[bug]: documentation wrong regarding adding next-themes
2 participants