mirror of
https://github.com/Luchexx/wacrm.git
synced 2026-11-02 09:19:51 +00:00
Merge pull request #208 from ArnasDon/fix/theme-hydration-warning
fix(theme): suppress hydration warning on root html data-theme (#207)
This commit is contained in:
commit
75ff74730f
@ -70,6 +70,13 @@ export default function RootLayout({
|
||||
lang="en"
|
||||
data-theme={DEFAULT_THEME}
|
||||
className={`${inter.variable} h-full antialiased`}
|
||||
// The `theme-boot` script below rewrites `data-theme` on <html>
|
||||
// from localStorage before React hydrates, so for any non-default
|
||||
// theme the client DOM intentionally differs from the server-
|
||||
// rendered `DEFAULT_THEME`. suppressHydrationWarning silences the
|
||||
// expected mismatch — it only applies to this element's own
|
||||
// attributes, so genuine mismatches in children still surface.
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<head>
|
||||
<Script
|
||||
|
||||
Loading…
Reference in New Issue
Block a user