How to re-trigger validations manually in ReduxForm?

前端 未结 3 1263
暗喜
暗喜 2021-01-07 23:23

I like to re-trigger validations after the form has mounted. Let\'s assume I like to run the validations each time I click a button named \'validate inputs\'.

How to

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-08 00:00

    The sync validation is run on every render, so "triggering it" doesn't really have much meaning.

    If you would like to use async validation, there is a this.props.asyncValidate() function that you can call to trigger it.

    OR, if you prefer submit validation, you could just submit the form.

提交回复
热议问题