Skip to content

Commit acc670e

Browse files
authored
Merge pull request #9 from devrnt/chore/throw-error-on-next-step
chore: throw error on next step
2 parents af53c8f + b4d3286 commit acc670e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wizard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Handler, WizardProps } from './types';
44
import WizardContext from './wizardContext';
55

66
const Wizard: React.FC<WizardProps> = React.memo(
7-
({ header, footer, startIndex = 0, children }) => {
8-
const [activeStep, setActiveStep] = React.useState(startIndex);
7+
({ header, footer, children }) => {
8+
const [activeStep, setActiveStep] = React.useState(0);
99
const [isLoading, setIsLoading] = React.useState(false);
1010
const hasNextStep = React.useRef(true);
1111
const hasPreviousStep = React.useRef(false);
@@ -42,6 +42,7 @@ const Wizard: React.FC<WizardProps> = React.memo(
4242
goToNextStep();
4343
} catch (error) {
4444
setIsLoading(false);
45+
throw error;
4546
}
4647
} else {
4748
goToNextStep();

0 commit comments

Comments
 (0)