reactjsformsreact-final-formfinal-form

React final form how to manually trigger validation


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.


Solution

  • 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