diff --git a/src/hooks/useOutsideClick/useOutsideClick.tsx b/src/hooks/useOutsideClick/useOutsideClick.tsx index 6f7b2c5b44..c8dfcde2df 100644 --- a/src/hooks/useOutsideClick/useOutsideClick.tsx +++ b/src/hooks/useOutsideClick/useOutsideClick.tsx @@ -2,7 +2,7 @@ import React from 'react'; export interface UseOutsideClickProps { ref: React.RefObject; - handler?: () => void; + handler?: (e: MouseEvent | TouchEvent) => void; } type UseOutsideClickType = (props: UseOutsideClickProps) => void; @@ -21,7 +21,7 @@ export const useOutsideClick: UseOutsideClickType = ({ref, handler}) => { const elem = ref?.current; if (elem && !elem.contains(e.target as Node) && handler) { - handler(); + handler(e); } };