Download src/components/wizard/useWizard.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 447 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/6ff863345b02fbc4abdd783ea02b0d2f8fac9643/src/components/wizard/useWizard.ts
- Command line
-
hf download hf://chenbhao/codev@6ff863345b02fbc4abdd783ea02b0d2f8fac9643/src/components/wizard/useWizard.ts
-
curl -L -o useWizard.ts https://huggingface.co/chenbhao/codev/resolve/6ff863345b02fbc4abdd783ea02b0d2f8fac9643/src/components/wizard/useWizard.ts
447 Bytes
| import { useContext } from 'react' | |
| import type { WizardContextValue } from './types.js' | |
| import { WizardContext } from './WizardProvider.js' | |
| export function useWizard< | |
| T extends Record<string, unknown> = Record<string, unknown>, | |
| >(): WizardContextValue<T> { | |
| const context = useContext(WizardContext) as WizardContextValue<T> | null | |
| if (!context) { | |
| throw new Error('useWizard must be used within a WizardProvider') | |
| } | |
| return context | |
| } | |