How to Detect Clicks Outside a React Component Using a Custom Hook

Many user interfaces use components that appear based on events such as a button click. When you work with such a component, you’ll want a way of hiding it again, usually in response to a click outside its boundary.



via MakeUseOf https://ift.tt/Pla1Btw

Comments