UNPKG

@hackplan/polaris

Version:

Shopify’s product component library

10 lines (9 loc) 409 B
import { useContext } from 'react'; import { ThemeContext } from './context'; export function useTheme() { const theme = useContext(ThemeContext); if (!theme) { throw new Error('No Theme was provided. Your application must be wrapped in an <AppProvider> component. See https://polaris.shopify.com/components/structure/app-provider for implementation instructions.'); } return theme; }