Next.js Discord

Discord Forum

What's causing this, I am unable to diagnose.

Answered
Appenzeller Sennenhund posted this in #help-forum
Open in Discord
Appenzeller SennenhundOP
I am using Next js with shadcn/ui and just intalled its version of dark mode from its docs
Answered by Asian black bear
You forgot to add supressHydrationWarning on the html element in the root layout.
View full answer

6 Replies

@Appenzeller Sennenhund Did you try it in guest mode?
@James4u <@728504942226178127> Did you try it in guest mode?
Appenzeller SennenhundOP
similar results on firefox, brave and guest mode
Asian black bear
You forgot to add supressHydrationWarning on the html element in the root layout.
Answer
@Asian black bear You forgot to add `supressHydrationWarning` on the `html` element in the root layout.
Appenzeller SennenhundOP
oh, was that to be done when I was installing shadcn?
Asian black bear
When you add next-themes you have to add that prop. It’s in the example on the shadcn page.
@Asian black bear When you add next-themes you have to add that prop. It’s in the example on the shadcn page.
Appenzeller SennenhundOP
Yoo thanks a lot that helped :))