"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useMeasuredHeight = useMeasuredHeight;
const react_1 = require("react");
function useMeasuredHeight(ref, fallback = 56) {
    const [h, setH] = (0, react_1.useState)(fallback);
    (0, react_1.useLayoutEffect)(() => {
        const el = ref.current;
        if (!el)
            return;
        const update = () => setH(el.getBoundingClientRect().height || fallback);
        const ro = new ResizeObserver(update);
        ro.observe(el);
        update();
        return () => ro.disconnect();
    }, [ref, fallback]);
    return h;
}
//# sourceMappingURL=useMeasuredHeight.js.map