import * as React from 'react'; import usePopover from './usePopover'; type PopoverContextType = ReturnType | null; export const PopoverContext = React.createContext( {} as PopoverContextType ); const usePopoverContext = (): PopoverContextType => { const context = React.useContext(PopoverContext); if (context === null) { throw new Error('Popover components must be wrapped in '); } return context; }; export default usePopoverContext;