feat: created `useSuperForm` hook

pull/111/head
Samuel Rowe 3 years ago
parent c2d130b011
commit 1c88dc6621

@ -1,3 +1,4 @@
export * from "./useTitle";
export * from "./useAccordionState";
export * from "./useTabContext";
export * from "./useSuperForm";

@ -0,0 +1,12 @@
import { useContext } from "react";
import { SuperFormContext } from "../contexts";
import { ISuperFormContext } from "../types";
export const useSuperForm = (): ISuperFormContext => {
const context = useContext(SuperFormContext);
if (!context) {
throw new Error("Cannot find super form context!");
}
return context;
};
Loading…
Cancel
Save