Fix React hydration mismatch errors
Add suppressHydrationWarning to html element to prevent hydration mismatch caused by theme script setting dark class before React hydration completes. The hydration errors were preventing checkout and other interactive features from working properly. This tells React to ignore the mismatch on the html element since we intentionally modify it before hydration. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
3d48e4d545
commit
017b68f17b
+1
-1
@@ -38,7 +38,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
|||||||
maintenanceMode && !pathname.startsWith('/admin') && !(await isAdminAuthenticated());
|
maintenanceMode && !pathname.startsWith('/admin') && !(await isAdminAuthenticated());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="en" className={`${fraunces.variable} ${inter.variable} ${mono.variable} ${caveat.variable}`}>
|
<html lang="en" suppressHydrationWarning className={`${fraunces.variable} ${inter.variable} ${mono.variable} ${caveat.variable}`}>
|
||||||
<head>
|
<head>
|
||||||
{/* Extra fonts available in the design tool's text options (loaded by real
|
{/* Extra fonts available in the design tool's text options (loaded by real
|
||||||
family name so the canvas can reference them directly). */}
|
family name so the canvas can reference them directly). */}
|
||||||
|
|||||||
Reference in New Issue
Block a user