suppressHydrationWarning not work at all
Answered
Atlantic mackerel posted this in #help-forum
Atlantic mackerelOP
Hey guys, Im trying to add dark mode use ThemeProvider
but when I after added this, the error said
So I search it, and I found suppressHydrationWarning option on body so I did it
But the error said same thing as before.
How can I fix it?
but when I after added this, the error said
app-index.js:35 Warning: Extra attributes from the server: class,styleSo I search it, and I found suppressHydrationWarning option on body so I did it
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const CookieProviderOverride = UserCookieProvider as any;
return (
<html lang="en">
<body className={inter.className} suppressHydrationWarning={true}>
<CookieProviderOverride>
{children}
</CookieProviderOverride>
</body>
</html>
);
}But the error said same thing as before.
How can I fix it?
2 Replies
@joulev next-themes? add the prop to `<html>` not `<body>`
Atlantic mackerelOP
oh wow it solved I thought it was on body property lmao