UNPKG

@shopify/polaris

Version:

Shopify’s admin product component library

16 lines (11 loc) 329 B
import { useContext } from 'react'; import { MissingAppProviderError } from '../errors.js'; import { ThemeContext } from './context.js'; function useTheme() { const theme = useContext(ThemeContext); if (!theme) { throw new MissingAppProviderError('No Theme was provided.'); } return theme; } export { useTheme };