UNPKG

@shopify/polaris

Version:

Shopify’s product component library

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