Next.js Discord

Discord Forum

Next-Themes HydrationError

Unanswered
Florian posted this in #help-forum
Open in Discord
How can I do something like this without getting an hydration error?

4 Replies

Plott Hound
In addition to what joulev posted… You will always get a hydration error on the html element since it is being manipulated after the client has mounted. For this reason you will need to add suppressHydrationWarning to the html tag in your layout. It only works one level deep so don’t worry about this suppressing hydration errors for children of html.
Thank you so much!