useOnClickOutside
function useOnClickOutside(fn): RefCallback<HTMLElement>;
Hook that only runs callback on click events outside of the referenced element
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | () => void | the function to be called on click outside |
Returns
RefCallback<HTMLElement>
a ref to the element where we are listening for clicks