import { useEffect } from "react";
const useResizeObserver = ({
  callback,
  element
}) => {
  useEffect(() => {
    if (!window?.ResizeObserver) {
      return;
    }
    const observer = new ResizeObserver(callback);
    if (element) {
      observer.observe(element);
    }
    return () => {
      observer.disconnect();
    };
  }, [element, callback]);
};
export {
  useResizeObserver
};
//# sourceMappingURL=use-resize-observer.js.map
