Skip to main content

Interface: FormContextType<T>

Defined in: types/index.ts:38

Context type that provides form state and methods to child components.

Type Parameters​

T​

T extends object

The type of the form data object

Properties​

form​

form: null | FormState<T>

Defined in: types/index.ts:40

The form state instance containing all form data and methods


touched​

touched: Record<keyof T, boolean>

Defined in: types/index.ts:42

Object tracking which fields have been touched by the user


submitForm()​

submitForm: () => void

Defined in: types/index.ts:44

Function to submit the form, triggering validation and onSubmit callback

Returns​

void


submitting​

submitting: boolean

Defined in: types/index.ts:46

Boolean indicating if the form is currently being submitted


validationErrors​

validationErrors: null | Record<string, ValidationError[]>

Defined in: types/index.ts:48

Validation errors organized by field path


validate()​

validate: () => void

Defined in: types/index.ts:50

Function to validate the form without submitting

Returns​

void


touch()​

touch: (fieldName) => void

Defined in: types/index.ts:52

Function to mark a specific field as touched

Parameters​

fieldName​

string

Returns​

void


initialized​

initialized: boolean

Defined in: types/index.ts:54

Set to true when initial values become available