mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
chore: let code breath
This commit is contained in:
@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user