src/components/Popup/Popup.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)) {
        console.log('You clicked outside of me!')
        cb()
      }
    }
function handleClickOutside ( event ) { if ( ref . current && ! ref . current . contains ( event . target ) ) { console . log ( 'You clicked outside of me!' ) cb ( ) } }
Alert if clicked on outside of element
Alert if clicked on outside of element