mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-09 07:28:55 -07:00
10 lines
No EOL
279 B
TypeScript
10 lines
No EOL
279 B
TypeScript
import { useContext } from 'react';
|
|
import { ThemeContext } from '../providers/ThemeProvider';
|
|
|
|
export function useTheme() {
|
|
const context = useContext(ThemeContext);
|
|
if (!context) {
|
|
throw new Error('useTheme must be used within a ThemeProvider');
|
|
}
|
|
return context;
|
|
} |