Skip to content

Commit 4e4a148

Browse files
authored
Merge pull request #41 from devrnt/chore/shave-some-bytes
Chore/shave some bytes
2 parents c6e1247 + cd8aa76 commit 4e4a148

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/wizard.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Wizard: React.FC<WizardProps> = React.memo(
1010
const [isLoading, setIsLoading] = React.useState(false);
1111
const hasNextStep = React.useRef(true);
1212
const hasPreviousStep = React.useRef(false);
13-
const nextStepHandler = React.useRef<Handler>(() => Promise.resolve());
13+
const nextStepHandler = React.useRef<Handler>(() => {});
1414

1515
hasNextStep.current =
1616
activeStep < React.Children.toArray(children).length - 1;
@@ -22,7 +22,7 @@ const Wizard: React.FC<WizardProps> = React.memo(
2222
}
2323
});
2424

25-
const previousStep = React.useRef((step?: number) => {
25+
const goToPreviousStep = React.useRef((step?: number) => {
2626
if (hasPreviousStep.current) {
2727
setActiveStep((activeStep) => step ?? activeStep - 1);
2828
}
@@ -53,12 +53,12 @@ const Wizard: React.FC<WizardProps> = React.memo(
5353
const wizardValue = React.useMemo(
5454
() => ({
5555
nextStep: doNextStep.current,
56-
previousStep: previousStep.current,
56+
previousStep: goToPreviousStep.current,
5757
handleStep: handleStep.current,
5858
isLoading,
5959
activeStep,
60-
isFirstStep: Boolean(!hasPreviousStep.current),
61-
isLastStep: Boolean(!hasNextStep.current),
60+
isFirstStep: !hasPreviousStep.current,
61+
isLastStep: !hasNextStep.current,
6262
}),
6363
[activeStep, isLoading],
6464
);
@@ -94,9 +94,9 @@ const Wizard: React.FC<WizardProps> = React.memo(
9494
return (
9595
<WizardContext.Provider value={wizardValue}>
9696
<>
97-
{header && header}
97+
{header}
9898
{activeStepContent}
99-
{footer && footer}
99+
{footer}
100100
</>
101101
</WizardContext.Provider>
102102
);

0 commit comments

Comments
 (0)