mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-03-22 02:51:53 +00:00
update: init
This commit is contained in:
12
src/hooks/use-theme.ts
Normal file
12
src/hooks/use-theme.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { useContext } from "react";
|
||||
import { ThemeProviderContext } from "../components/ThemeProvider";
|
||||
|
||||
export const useTheme = () => {
|
||||
const context = useContext(ThemeProviderContext);
|
||||
|
||||
if (context === undefined) {
|
||||
throw new Error("useTheme must be used within a ThemeProvider");
|
||||
}
|
||||
|
||||
return context;
|
||||
};
|
||||
Reference in New Issue
Block a user