Fix hydration mismatch from theme blocking script
The inline script adds the 'dark' class to <html> before React hydrates, causing a server/client className mismatch. suppressHydrationWarning on <html> is the standard Next.js fix for this pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,7 @@ export default function RootLayout({
|
|||||||
<html
|
<html
|
||||||
lang="en"
|
lang="en"
|
||||||
className={`${headingFont.variable} ${bodyFont.variable} h-full antialiased`}
|
className={`${headingFont.variable} ${bodyFont.variable} h-full antialiased`}
|
||||||
|
suppressHydrationWarning
|
||||||
>
|
>
|
||||||
<head>
|
<head>
|
||||||
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
|
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
|
||||||
|
|||||||
Reference in New Issue
Block a user