const validate = values => {
/* returned object has all errors with name of field as key and error message as value */
const errors = {};
if (!values.userName) {
errors.userName = 'Please enter User Name';
} // ... rest of conditions return errors;
}
const SampleForm = () => ( // ...sample form markup );
return reduxForm({ validate, ...otherValues })(SampleForm);
Created
January 25, 2018 07:12
-
-
Save prasanna1211/860e942ef698e03550cbdff1eec41ef0 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment