UNPKG

@base-ui/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.

24 lines (23 loc) 523 B
'use client'; import * as React from 'react'; import { NOOP } from "../noop.mjs"; export const FormContext = /*#__PURE__*/React.createContext({ elementRef: { current: null }, formRef: { current: { fields: new Map() } }, errors: {}, clearErrors: NOOP, validationMode: 'onSubmit', submitAttemptedRef: { current: false } }); if (process.env.NODE_ENV !== "production") FormContext.displayName = "FormContext"; export function useFormContext() { return React.useContext(FormContext); }