chore: let code breath

This commit is contained in:
mikezzb
2023-12-03 11:21:51 -05:00
parent 40a4ec4436
commit 43b1a14415

View File

@ -56,7 +56,9 @@ export const Stepper: FC<StepperProps> = ({
}, [currentStep, onStepChanged]);
// Empty stepper
if (totalSteps === 0) return null;
if (totalSteps === 0) {
return null;
}
const currentChild = React.Children.toArray(children)[currentStep - 1];
@ -76,6 +78,8 @@ export const Stepper: FC<StepperProps> = ({
/** Hook for children to use the step context */
export const useStep = (): StepContextType => {
const context = useContext(StepContext);
if (!context) throw new Error('useStep must be used within a Stepper');
if (!context) {
throw new Error('useStep must be used within a Stepper');
}
return context;
};