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.
The value of the field upon creation only if both the field's
undefined and the value from the form's
initialValues is also
undefined. The field will be
defaultValue is used.
() => (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.
true, no form or field listeners (apart from the one currently registering) will be notified of anything that has changed with the registration of this field. Shhhh!!
This can be useful to do a "dry run" of registering a field and immediately unregistering it to get an initial state for that field without disturbing all the other listeners.
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.