UNPKG

@shopify/polaris

Version:

Shopify’s product component library

15 lines (10 loc) 408 B
import { useContext } from 'react'; import { FrameContext } from './context.js'; function useFrame() { var frame = useContext(FrameContext); if (!frame) { throw new Error('No Frame context was provided. Your component must be wrapped in a <Frame> component. See https://polaris.shopify.com/components/structure/frame for implementation instructions.'); } return frame; } export { useFrame };