import { createContext, useContext } from 'react';
import { FormContextNotFoundError } from './error';
export var FormContext = createContext(null);
FormContext.displayName = 'FormContext';
export var FormProvider = FormContext.Provider;
export function useFormContext(quiet) {
    if (quiet === void 0) { quiet = false; }
    var ctx = useContext(FormContext);
    if (ctx === null && !quiet) {
        throw FormContextNotFoundError;
    }
    return ctx;
}
export default FormContext;
