Skip to content

Commit

Permalink
docs(examples): update App Router example to avoid hydration mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack committed Feb 26, 2024
1 parent e1dbd6a commit b7fee53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"private": true,
"scripts": {
"clean": "rimraf .next",
"build": "next build",
"develop": "next",
"start": "next start",
"type-check": "tsc --noEmit"
},
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion examples/app-router/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export const metadata = {

export default function RootLayout({children}: {children: React.ReactNode}) {
return (
<html lang="en">
// Note: the `ThemeProvider` component will set attributes on `html` once
// they load on the client that will cause a hydration mismatch
<html lang="en" suppressHydrationWarning>
<body>
<StyledComponentsRegistry>
<ThemeProvider>
Expand Down

0 comments on commit b7fee53

Please sign in to comment.