()
| 3 | import { WizardContext } from './WizardProvider.js' |
| 4 | |
| 5 | export function useWizard< |
| 6 | T extends Record<string, unknown> = Record<string, unknown>, |
| 7 | >(): WizardContextValue<T> { |
| 8 | const context = useContext(WizardContext) as WizardContextValue<T> | null |
| 9 | if (!context) { |
| 10 | throw new Error('useWizard must be used within a WizardProvider') |
| 11 | } |
| 12 | return context |
| 13 | } |
| 14 |
no outgoing calls
no test coverage detected