Home > Back-end >  React final form how to manually trigger validation
React final form how to manually trigger validation

Time:01-25

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.

CodePudding user response:

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

  •  Tags:  
  • Related