"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/hooks/useLiveRef.tsx
var _react = require('react');
var defaultRef = { current: null };
function useLiveRef() {
  const [ready, setReady] = _react.useState.call(void 0, false);
  const ref = _react.useRef.call(void 0, null);
  const refCb = _react.useCallback.call(void 0, (node) => {
    if (node !== null) {
      ref.current = node;
      setReady(true);
    }
  }, []);
  const value = _react.useMemo.call(void 0, 
    () => [ready ? ref : defaultRef, refCb],
    [ready, ref, refCb]
  );
  return value;
}



exports.useLiveRef = useLiveRef;
