Skip to content

Commit

Permalink
Add suppressHydrationWarning for nextJS
Browse files Browse the repository at this point in the history
Using darkMode can lead to an hydratation warning.

As described in nextjs doc `While rendering your application, there was a difference between the React tree that was pre-rendered from the server and the React tree that was rendered during the first render in the browser (hydration).`

https://nextjs.org/docs/messages/react-hydration-error

https://github.com/pacocoursey/next-themes?tab=readme-ov-file#with-app
  • Loading branch information
sylwit authored Mar 31, 2024
1 parent cccda3e commit 1841777
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/web/content/docs/guides/next-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import { ThemeModeScript } from "flowbite-react";

export default function RootLayout({ children }) {
return (
<html>
<html suppressHydrationWarning>
<head>
<ThemeModeScript />
</head>
Expand All @@ -165,7 +165,7 @@ import { ThemeModeScript } from "flowbite-react";

export default function Document() {
return (
<Html>
<Html suppressHydrationWarning>
<Head>
<ThemeModeScript />
</Head>
Expand Down

0 comments on commit 1841777

Please sign in to comment.