import { useState as n, useEffect as u } from "react";
const d = (t) => {
  const [s, c] = n(), [o, i] = n();
  return u(() => {
    const r = new ResizeObserver((h) => {
      for (const e of h)
        e.contentRect && (c(e.contentRect.width), i(e.contentRect.height));
    });
    return t.current && r.observe(t.current), () => {
      r.disconnect();
    };
  }, [t]), [s, o];
};
export {
  d as default
};
//# sourceMappingURL=useElementSize.js.map
