πŸ“„ 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
}