client/src/components/general/ClickAway.js
/**
     * Alert if clicked on outside of element
     */
Alert if clicked on outside of element
Alert if clicked on outside of element
function handleClickOutside(event) {
      if (ref.current && !ref.current.contains(event.target)) {
        onClickAway()
      }
    }
function handleClickOutside ( event ) { if ( ref . current && ! ref . current . contains ( event . target ) ) { onClickAway ( ) } }
Alert if clicked on outside of element
Alert if clicked on outside of element