jan/web/app/_helpers/ThemeWrapper.tsx
2023-10-20 11:29:10 +07:00

16 lines
431 B
TypeScript

'use client'
import { ThemeProvider } from 'next-themes'
import { ReactNode } from 'react'
type Props = {
children: ReactNode
}
// consider to use next-themes or not. This caused the error Warning: Extra attributes from the server: class,style at html after hydration
export const ThemeWrapper: React.FC<Props> = ({ children }) => (
<ThemeProvider enableSystem={false} attribute="class">
{children}
</ThemeProvider>
)