-
This is my theme provider "use client"
import * as React from "react"
import { ThemeProvider as NextThemesProvider } from "next-themes"
export function ThemeProvider({
children,
...props
}: React.ComponentProps<typeof NextThemesProvider>) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
} My layout import type { Metadata } from "next"
import "./globals.css"
import Header from "@/components/Header"
import { ThemeProvider } from "@/components/ThemeProvider"
import Footer from "@/components/Footer"
export const metadata: Metadata = {
title: "Bookmendator",
description: "Generated by create next app",
}
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
return (
<html lang="en">
<body>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<Header />
{children}
<Footer />
</ThemeProvider>
</body>
</html>
)
} I have this error: |
Beta Was this translation helpful? Give feedback.
Answered by
Smnthjm08
Nov 13, 2024
Replies: 1 comment 1 reply
-
add this for the html tag in the root layout |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Rafacv23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add this for the html tag in the root layout
<html lang="en" suppressHydrationWarning>
. This should fix it.