Skip to content

Commit

Permalink
Add suppressHydrationWarning for nextJS (#1335)
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 Jun 19, 2024
1 parent 99845ad commit c580a26
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 @@ -150,7 +150,7 @@ import { ThemeModeScript } from "flowbite-react";

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

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

0 comments on commit c580a26

Please sign in to comment.