fix: suppress hydration warning on html for theme-init class
theme-init.js adds the 'dark' class to <html> before React hydrates, causing a hydration mismatch (React #418) for users with a saved dark theme. Mark the root element with suppressHydrationWarning.
This commit is contained in:
1 parent
30ed2b8ce2
commit
450e7e8d00
1 file changed
+1
-1
+1
-1
@@ -52,7 +52,7 @@ export default async function RootLayout({
|
||||
const nonce = (await headers()).get("x-nonce") ?? undefined;
|
||||
|
||||
return (
|
||||
<html lang={locale} className="app">
|
||||
<html lang={locale} className="app" suppressHydrationWarning>
|
||||
<head>
|
||||
<meta name="theme-default-dark" content={String(defaultDark)} />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
|
||||
Reference in new issue
Block a user