@shopify/polaris
Version:
Shopify’s product component library
16 lines (11 loc) • 327 B
JavaScript
import { useContext } from 'react';
import { ThemeContext } from './context.js';
import { MissingAppProviderError } from '../errors.js';
function useTheme() {
var theme = useContext(ThemeContext);
if (!theme) {
throw new MissingAppProviderError('No Theme was provided.');
}
return theme;
}
export { useTheme };