React final form how to manually trigger validation

6.1k Views Asked by At

I would like to call validate manually, can we do it from final form API? I've searched on the doc but didn't see any instruction about it.

My situation is that when I update the validate function, it does not rerun so I want to manually trigger it to run with the new validator function.

1

There are 1 best solutions below

0
Quoc Van Tang On BEST ANSWER

Following the docs https://final-form.org/docs/react-final-form/types/FieldProps#validate, so updating another props (e.g key) of Field component will trigger the validation