How to re-trigger validations manually in ReduxForm?

Chk picture Chk · Nov 30, 2016 · Viewed 11.3k times · Source

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 do this?

Related questions:

Answer

Már Örlygsson picture Már Örlygsson · Jun 27, 2018

Manual redux-form validation is an oft requested feature, that does not seem to be provided at the moment.

My personal workaround is to trigger this.props.change('_validationHack', Date.now()) in the reduxForm-wrapped component and then remove values._validationHack in the onSubmit method before sending the values to the server.

It's not pretty, but seems to work without exception.