import { useLayoutEffect, useState } from 'react';
export function useMeasuredHeight(ref, fallback = 56) {
    const [h, setH] = useState(fallback);
    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