useOnClickOutside
Fires a callback when the user clicks outside the referenced element.
Installation
Usage
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| ref* | RefObject<T> | required | Ref attached to the element to watch. |
| handler* | (e: MouseEvent) => void | required | Called on outside click. |
| enabled | boolean | true | Disable the listener temporarily. |