text: import {useContext} from "react";
  import {isRecord} from "../../lib/isRecord";
  import {PortalContext} from "./portalContext";
  function usePortal() {
    const value = useContext(PortalContext);
    if (!value) {
      throw new Error("usePortal(): missing context value");
    }
    if (!isRecord(value) || value.version !== 0) {
      throw new Error("usePortal(): the context value is not compatible");
    }
    return value;
  }
  export {
    usePortal
  };
  