Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong type definition for typescript when using instance #103

Open
GeenCo86 opened this issue Jan 20, 2022 · 1 comment
Open

Wrong type definition for typescript when using instance #103

GeenCo86 opened this issue Jan 20, 2022 · 1 comment

Comments

@GeenCo86
Copy link

What is wrong:

StepWizard has the wrong type definition for the instance callback.

What I would expect:

interface StepWizardTransitionProps {
    enterRight?: string;
    enterLeft?: string;
    exitRight?: string;
    exitLeft?: string;
    intro?: string;
}
interface StepWizardInstanceProps {
    getHash: () => string;
    getTransitions: () => StepWizardTransitionProps;
    onHashChange: () => void;
    isInvalidStep: (next: number) => boolean;
    setActiveStep: (next: number) => void;
    // do we need onStepChange ??
    currentStep: number;
    totalSteps: number;
    getSteps: () => ReactElement[];
    firstStep: () => void;
    lastStep: () => void;
    nextStep: () => void;
    previousStep: () => void;
    goToStep: (step: number) => void;
    goToNamedStep: (stepName: string) => void;
    updateHash: (activeHash: string) => void;
}

instance: (wizard: StepWizardInstanceProps) => void

@mptsonev
Copy link

+1 on this, StepWizardInstanceProps should also have the state prop with active step etc. @jcmcneal I can contribute this change if you believe this to be a real issue 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants