import { useContext } from "react";
import { invariant } from "../invariant";

export default function useRequiredContext(Context) {
  const result = useContext(Context);
  invariant(result, "Could not find required context");
  return result;
}
