@lynxts/core • Docs
@lynxts/core / FormProviderProps
The FormProvider component props.
• T extends Struct
struct type of the form values
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.
onSubmit: (
values
) =>void
The function to be called uppon form submision.
• values: T
the validated values T
of the form
void
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.
optional
values:DeepPartial
<T
>
The values T
of the form. Changing this prop with a state will change
the field values as well.