Files
website/src/hooks/useTheme.tsx
T

13 lines
284 B
TypeScript

import { useContext } from "react"
import { IThemeContext, ThemeContext } from "../ThemeProvider"
export default function useTheme(): IThemeContext {
const themeContext = useContext(ThemeContext)
if (!themeContext) {
throw Error("Need context")
}
return themeContext
}