How to detect a click outside of an element (straightforwardly)

Learn how to create a “useOutsideClick” hook in the most straightforward way possible. The hook name is self explanatory, it is used to…