import*as e from"react";import{useLayoutEffect as t}from"../../react-use-layout-effect/dist/index.js";function r(r){const[i,o]=e.useState(void 0);return t((()=>{if(r){o({width:r.offsetWidth,height:r.offsetHeight});const e=new ResizeObserver((e=>{if(!Array.isArray(e))return;if(!e.length)return;const t=e[0];let i,s;if("borderBoxSize"in t){const e=t.borderBoxSize,r=Array.isArray(e)?e[0]:e;i=r.inlineSize,s=r.blockSize}else i=r.offsetWidth,s=r.offsetHeight;o({width:i,height:s})}));return e.observe(r,{box:"border-box"}),()=>e.unobserve(r)}o(void 0)}),[r]),i}export{r as useSize};
//# sourceMappingURL=index.js.map
