UNPKG

vroom-react

Version:
14 lines (9 loc) 322 B
import { useContext } from 'react' import { VroomUIContext, VroomUIContextValue } from './VroomUIContext' export function useVroomUI(): VroomUIContextValue { const context = useContext(VroomUIContext) if (!context) { throw new Error(`useVroomSdk must be used within a VroomUIProvider.`) } return context }