Components/useOnClickOutside

useOnClickOutside

Fires a callback when the user clicks outside the referenced element.

Installation

Usage

API Reference

PropTypeDefaultDescription
ref*RefObject<T>requiredRef attached to the element to watch.
handler*(e: MouseEvent) => voidrequiredCalled on outside click.
enabledbooleantrueDisable the listener temporarily.