import{useRef as c,useLayoutEffect as s,useEffect as d}from"react";function m(t){const n=c(null),r=c(t);return s(()=>{r.current=t}),d(()=>{const e=u=>{const o=n.current;o&&!o.contains(u.target)&&r.current(u)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[]),n}export{m as useClickAway};
//# sourceMappingURL=useClickAway.js.map
