Skip to content

How to used the useStepper hooks across different components? #58

Answered by caturbgs
caturbgs asked this question in Q&A
Discussion options

You must be logged in to vote

Fix this with avoid define/called a hooks useStepper() on the layout.tsx file, so I'm refactored the stepper component inside the layout into the independent component.

layout.tsx

"use client";

import { defineStepper } from "@stepperize/react";
import { useEffect } from "react";
import StepperLayout from "./stepper";

export const Stepper = defineStepper(
  {
    id: "step-1",
    title: "Step 1",
    description: "Description step 1",
  },
  {
    id: "step-2",
    title: "Step 2",
    description: "Description step 2",
  }
);

export default function StepperizeLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <div className="flex flex-col items-center…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@damianricobelli
Comment options

@caturbgs
Comment options

@caturbgs
Comment options

@caturbgs
Comment options

Answer selected by caturbgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants