A hook that can track a click event outside a ref. Returns a callbackRef.
Arguments | Type | Description | Default value |
---|---|---|---|
handler | function | Callback to fire on outside click | |
when | boolean | A boolean which which activates the hook only when it is true. Useful for conditionally enable the outside click | true |
Returned Array items | Type | Description |
---|---|---|
ref | CallbackRef | ref |
Join our discord server! You can click the floating discord icon at the bottom right of the screen and chat with us!