import t from"@babel/runtime/helpers/slicedToArray";import{useState as e,useCallback as i,useEffect as h}from"react";var r=function(){var r=e(null),n=t(r,2),o=n[0],c=n[1],f=e({width:0,height:0}),d=t(f,2),u=d[0],g=d[1],s=i((function(t){c(t)}),[]);return h((function(){if(o){g({width:o.offsetWidth,height:o.offsetHeight});var t=new ResizeObserver((function(t){var e=t[0];e&&g({width:e.contentRect.width,height:e.contentRect.height})}));return t.observe(o),function(){return t.disconnect()}}g({width:0,height:0})}),[o]),{ref:s,width:u.width,height:u.height}};export{r as useElementSize};
//# sourceMappingURL=useElementSize.js.map
