vroom-react
Version:
Vroom React UI
14 lines (9 loc) • 322 B
text/typescript
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
}