UNPKG

@compositive/foundation

Version:

Compositive framework foundation package.

13 lines (10 loc) 378 B
import { isDefined } from '@compositive/commons-predicates'; import { useContext } from 'react'; import { ThemeContext, THEME_NOT_PROVIDED_ERROR } from './ThemeContext.js'; const useTheme = () => { const theme = useContext(ThemeContext); isDefined.assert(theme, THEME_NOT_PROVIDED_ERROR); return theme; }; export { useTheme }; //# sourceMappingURL=useTheme.js.map