client/src/components/general/ClickAway.js
/**
 * Component that alerts if you click outside of it
 */
Component that alerts if you click outside of it
Component that alerts if you click outside of it
function ClickAway(props) {
  const wrapperRef = useRef(null);
  useOutsideAlerter(wrapperRef, props.onClickAway);
  return <div ref={wrapperRef}>{props.contents}</div>;
}
function ClickAway ( props ) { const wrapperRef = useRef ( null ) ; useOutsideAlerter ( wrapperRef , props . onClickAway ) ; return < div ref = { wrapperRef } > { props . contents } < / div > ; }
Component that alerts if you click outside of it
Component that alerts if you click outside of it