Files
Charon/frontend/src/hooks/useTheme.ts
2026-01-26 19:22:05 +00:00

11 lines
290 B
TypeScript

import { useContext } from 'react'
import { ThemeContext } from '../context/ThemeContextValue'
export function useTheme() {
const context = useContext(ThemeContext)
if (context === undefined) {
throw new Error('useTheme must be used within a ThemeProvider')
}
return context
}