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

Fixed Issue Related to Hydration Error For AppDir #195

Closed
wants to merge 1 commit into from

Conversation

faraasat
Copy link

Fixed the Hydration Error issue in AppDir by using cookies. These cookies are sent on every page request and according to which theme is applied.

@vercel
Copy link

vercel bot commented Jul 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-themes-basic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2023 6:23pm
next-themes-tailwind ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2023 6:23pm

Copy link
Contributor

@WITS WITS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a cookies based approach in a fork of next-themes early on, but unfortunately if you reference cookies() in the app directory it opts out of static site generation. There's more info in this thread

@faraasat
Copy link
Author

Thanks for the review.

@faraasat faraasat closed this Aug 13, 2023
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.

None yet

2 participants