useOnOutsideClick Function

Invokes onOutsideClick handler when user clicks outside of referenced element.

useOnOutsideClick<T extends Element>(onOutsideClick?: () => void, outsideEventPredicate?: (e: OutsideClickEvent) => boolean): RefObject<T>

Parameter Type Description
onOutsideClick () => void  
outsideEventPredicate (e: OutsideClickEvent) => boolean  

Returns - RefObject<T>

Defined in

Last Updated: 12 June, 2024