@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
28 lines (27 loc) • 769 B
JavaScript
;
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FormContext = void 0;
exports.useFormContext = useFormContext;
var React = _interopRequireWildcard(require("react"));
var _noop = require("../utils/noop");
const FormContext = exports.FormContext = /*#__PURE__*/React.createContext({
formRef: {
current: {
fields: new Map()
}
},
errors: {},
clearErrors: _noop.NOOP,
validationMode: 'onSubmit',
submitAttemptedRef: {
current: false
}
});
if (process.env.NODE_ENV !== "production") FormContext.displayName = "FormContext";
function useFormContext() {
return React.useContext(FormContext);
}