Suppress body hydration warning from browser-extension attributes

Extensions like ColorZilla inject attributes (cz-shortcut-listen) into
<body> before React hydrates, causing a benign hydration mismatch.
suppressHydrationWarning on <body> is the standard fix; it only ignores
attribute diffs on <body> itself, not its children.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalid Abdi
2026-06-01 21:03:19 +03:00
parent bb7478433c
commit 01e345c3e1
+9 -1
View File
@@ -31,7 +31,15 @@ export default function RootLayout({
lang="en"
className={cn("dark", "h-full", "antialiased", geistSans.variable, geistMono.variable, "font-sans", inter.variable)}
>
<body className="h-dvh overflow-hidden flex flex-col">{children}</body>
{/* suppressHydrationWarning: browser extensions (e.g. ColorZilla's
cz-shortcut-listen) mutate <body> before hydration. Only ignores
attribute diffs on <body> itself, not its children. */}
<body
className="h-dvh overflow-hidden flex flex-col"
suppressHydrationWarning
>
{children}
</body>
</html>
);
}