Closed jonathantneal closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
stepperize | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 20, 2024 1:32am |
Latest commit: ef8d71ec165b799f1626d110b0508f816753eb49
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Replaces
Stepper
,defineSteps(..steps)
, anduseStepper<typeof steps>()
withdefineStepper(...steps)
, which returns auseStepper
hook automatically wired to the steps.defineStepper
also returns aScoped
component, which is a provider that will lock anyuseStepper
hooks within that component to the same steps.Before
```tsx import { defineSteps, useStepper } from "@stepperize/react" const steps = defineSteps( { id: "first" }, { id: "second" }, { id: "third" }, { id: "last" }, ) type Steps = typeof steps const MyFirstStepper = () => { return (This is the {step.id}
))} {stepper.when("second").render((step) => (This is the {step.id}
))} {stepper.when("third").render((step) => (This is the {step.id}
))} {stepper.when("last").render(() => (You have reached the end of the stepper
))} {!stepper.isLastStep ? (After
```tsx import { defineStepper } from "@stepperize/react" const { useStepper } = defineStepper( { id: "first" }, { id: "second" }, { id: "third" }, { id: "last" }, ) const MyFirstStepper = () => { const stepper = useStepper() return (This is the {step.id}
))} {stepper.when("second", (step) => (This is the {step.id}
))} {stepper.when("third", (step) => (This is the {step.id}
))} {stepper.when("last", () => (You have reached the end of the stepper
))} {!stepper.isLastStep ? (