I want to validate the forms as soon as it is loaded (yes, I know it will display all the error messages on relevant fields on form load, but this is exactly what I want).
I called this.props.validate() in componentDidMount() and I got the following error:
Uncaught Invariant Violation: Data was not provided to the Validator. Implement "getValidatorData" to return data.
However, the function getValidatorData() is implemented.
I want to validate the forms as soon as it is loaded (yes, I know it will display all the error messages on relevant fields on form load, but this is exactly what I want).
I called
this.props.validate()
incomponentDidMount()
and I got the following error:However, the function
getValidatorData()
is implemented.Validation works as expected while editing the form (so it seems that everything else is properly implemented).
How do I validate when the component gets mounted?