NewOldMax/react-native-validator-form

Display error message when...

Closed this issue · 1 comments

Could we have any props to display error messages when the element passed some rules, for example: after form is submitted or some flags are turned on?

To display messages only on submit, pass instantValidate = false to ValidatorForm. For some flags you should implement it in your input component that extends ValidatorComponent

export default class TextValidator extends Input {
   render() {
      ...
     const error = this.state.isValid ? '' : this.getErrorMessage();
     //do something with this error
   }
}