Skip to content

Latest commit

 

History

History
81 lines (44 loc) · 1.95 KB

FormProviderProps.md

File metadata and controls

81 lines (44 loc) · 1.95 KB

@lynxts/coreDocs


@lynxts/core / FormProviderProps

Interface: FormProviderProps<T>

The FormProvider component props.

Type Parameters

T extends Struct

struct type of the form values

Properties

children

children: ReactNode | ReactNode[] | (props) => ReactNode

The children of the provider may rather be any kind of React.js node(s), or a function which takes |RenderProps<T> and returns a React.js node.

Defined in

Form.provider.tsx:119


onSubmit()

onSubmit: (values) => void

The function to be called uppon form submision.

Parameters

values: T

the validated values T of the form

Returns

void

Defined in

Form.provider.tsx:125


validation

validation: ObjectSchema<T, AnyObject, any, ""> | ZodType<T, ZodTypeDef, T> | Adapter<T>

A validation schema of T used to validate the form fields. Both Yup and Zod schemas are supported out-of-the-box.

However, if you want to use another validation library, or your own schemas, you can also pass a validation Adapter which tells the form and the hooks how to handle the validation.

Defined in

Form.provider.tsx:134


values?

optional values: DeepPartial<T>

The values T of the form. Changing this prop with a state will change the field values as well.

Defined in

Form.provider.tsx:139