"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const reactBinding = require("@contember/react-binding");
const react = require("react");
const useGetParentEntityRef = () => {
  const key = reactBinding.useEntityKey();
  const getEntity = reactBinding.useGetEntityByKey();
  const [initialGetter] = react.useState(() => () => getEntity(key));
  const ref = react.useRef(initialGetter);
  react.useEffect(() => {
    ref.current = () => getEntity(key);
  }, [getEntity, key]);
  return ref;
};
exports.useGetParentEntityRef = useGetParentEntityRef;
//# sourceMappingURL=useGetParentEntityRef.cjs.map
