diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index b210b82c..76528947 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -20,6 +20,7 @@ export const Button = forwardRef( type = 'button', disabled = false, loading = false, + onClick, ...props }, ref, @@ -36,8 +37,25 @@ export const Button = forwardRef( [styles.loading]: loading, }); + const handleClick = (e: React.MouseEvent) => { + if (loading) { + e.preventDefault(); + return; + } + + onClick?.(e); + }; + return ( -