From b4c373625959c618e0ae908355b01b09348bb0f9 Mon Sep 17 00:00:00 2001 From: Andrew-Kang-G Date: Thu, 20 Jun 2024 12:37:38 +0900 Subject: [PATCH] Fixed the event of Button to be passed to the onClick function --- client/src/shared/components/Button/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/shared/components/Button/index.jsx b/client/src/shared/components/Button/index.jsx index 2a305377..5c4dd710 100644 --- a/client/src/shared/components/Button/index.jsx +++ b/client/src/shared/components/Button/index.jsx @@ -30,16 +30,16 @@ const defaultProps = { const Button = forwardRef( ({ children, variant, icon, iconSize, disabled, isWorking, onClick, ...buttonProps }, ref) => { - const handleClick = () => { + const handleClick = (e) => { if (!disabled && !isWorking) { - onClick(); + onClick(e); } }; return ( handleClick(e)} variant={variant} disabled={disabled || isWorking} isWorking={isWorking}