import * as React from 'react'; import useTooltip from './useTooltip'; type TooltipContextType = ReturnType | null; export const TooltipContext = React.createContext( {} as TooltipContextType ); const useTooltipContext = (): TooltipContextType => { const context = React.useContext(TooltipContext); if (context === null) { throw new Error('Tooltip components must be wrapped in '); } return context; }; export default useTooltipContext;