Refactor ThemeProvider to use React instead of Preact for improved compatibility

This commit is contained in:
ecwu
2024-12-25 14:43:28 +08:00
parent 756bf6cddd
commit 126fa4f9db

View File

@@ -1,10 +1,9 @@
import { createContext } from "preact"; import { createContext, useContext, useEffect, useState } from "react";
import { useContext, useEffect, useState } from "preact/hooks";
type Theme = "dark" | "light" | "system"; type Theme = "dark" | "light" | "system";
type ThemeProviderProps = { type ThemeProviderProps = {
children: preact.VNode; children: React.ReactNode;
defaultTheme?: Theme; defaultTheme?: Theme;
storageKey?: string; storageKey?: string;
}; };