Update context/theme-provider.tsx
This commit is contained in:
parent
b632c58038
commit
095cb24b42
|
|
@ -1,18 +1,18 @@
|
|||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import * as NextThemes from "next-themes";
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
||||
|
||||
/**
|
||||
* ThemeProvider wrapper for next-themes
|
||||
* Uses namespace import to avoid Turbopack naming collision
|
||||
* (Turbopack has issues when importing and re-exporting the same name)
|
||||
* next-themes v0.3.0+ changed its export structure.
|
||||
* Using a more robust way to handle types.
|
||||
*/
|
||||
export function ThemeProvider({
|
||||
children,
|
||||
...props
|
||||
}: NextThemes.ThemeProviderProps) {
|
||||
}: React.ComponentProps<typeof NextThemesProvider>) {
|
||||
return (
|
||||
<NextThemes.ThemeProvider {...props}>{children}</NextThemes.ThemeProvider>
|
||||
<NextThemesProvider {...props}>{children}</NextThemesProvider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue