useOnOutsideClick Function

Deprecated  in 4.15.0. Used internally.

Invokes onOutsideClick handler when user clicks outside of referenced element.

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

Parameter Type Description
onOutsideClick () => void  
outsideEventPredicate (e: OutsideClickEvent) => boolean Invoked for intermediate events. Return false to prevent outside click.

Returns - React.RefObject<T>

Defined in

Last Updated: 17 December, 2024