FieldConfig is an object containing the following values:
() => void
A callback to notify fields after submission has completed successfully.
() => void | false
A function to call just before calling
false, the submission will be aborted. If one of your fields returns
beforeSubmit, other fields may not have their
beforeSubmit called, as the submission is aborted on the first one that returns
Initial state for arbitrary values to be placed by mutators.
⚠️ You probably want
The value of the field upon creation. This value is only needed if you want your field be
dirty upon creation (i.e. for its value to be different from its initial value).
() => (value: any, allValues: FormValues, meta: FieldState) => any | Promise<any> | void
A callback that will return a field-level validation function to validate a single field value. The validation function should return an error if the value is not valid, or
undefined if the value is valid.
The initial value for the field. This value will be used to calculate
pristine by comparing it to the current value of the field. If you want field to be
dirty upon creation, you can set one value with
initialValue and set the value of the field with
The value given here will override any
initialValues given to the entire form.
(a: any, b: any) => boolean
Optional. Defaults to
A function to determine if two values are equal.
An array of field names to validate when this field changes. If
every field will be validated when this one changes; if
, only this
field will have its field-level validation function called when it changes; if
other field names are specified, those fields and this one will be validated
when this field changes.