π File detail
components/wizard/useWizard.ts
π§© .tsπ 14 linesπΎ 447 bytesπ text
β Back to All Filesπ― Use case
This file lives under βcomponents/β, which covers shared React UI pieces. On the API surface it exposes useWizard β mainly functions, hooks, or classes. Dependencies touch React UI. It composes internal code from types and WizardProvider (relative imports).
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
import { useContext } from 'react' import type { WizardContextValue } from './types.js' import { WizardContext } from './WizardProvider.js' export function useWizard<
π€ Exports (heuristic)
useWizard
π External import roots
Package roots from from "β¦" (relative paths omitted).
react
π₯οΈ Source preview
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
}