Skip to content

Commit 3f0b1b5

Browse files
authored
Merge pull request #95 from devrnt/fix/#94-handler-not-cleared
Fix/#94 handler not cleared
2 parents 01c6449 + 0dff0e0 commit 3f0b1b5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "React wizard (stepper) builder without the hassle, powered by hooks.",
55
"homepage": "https://github.com/devrnt/react-use-wizard#readme",
66
"module": "dist/react-use-wizard.esm.js",
7-
"version": "2.1.0",
7+
"version": "2.1.1-0",
88
"license": "MIT",
99
"main": "dist/index.js",
1010
"typings": "dist/index.d.ts",

src/wizard.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ const Wizard: React.FC<WizardProps> = React.memo(
2424

2525
const goToPreviousStep = React.useRef(() => {
2626
if (hasPreviousStep.current) {
27+
nextStepHandler.current = null;
2728
setActiveStep((activeStep) => activeStep - 1);
2829
}
2930
});
3031

3132
const goToStep = React.useRef((stepIndex: number) => {
3233
if (stepIndex >= 0 && stepIndex < stepCount) {
34+
nextStepHandler.current = null;
3335
setActiveStep(stepIndex);
3436
} else {
3537
if (__DEV__) {

0 commit comments

Comments
 (0)