mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
chore: let code breath
This commit is contained in:
@ -56,7 +56,9 @@ export const Stepper: FC<StepperProps> = ({
|
|||||||
}, [currentStep, onStepChanged]);
|
}, [currentStep, onStepChanged]);
|
||||||
|
|
||||||
// Empty stepper
|
// Empty stepper
|
||||||
if (totalSteps === 0) return null;
|
if (totalSteps === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const currentChild = React.Children.toArray(children)[currentStep - 1];
|
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 */
|
/** Hook for children to use the step context */
|
||||||
export const useStep = (): StepContextType => {
|
export const useStep = (): StepContextType => {
|
||||||
const context = useContext(StepContext);
|
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;
|
return context;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user