Created
January 26, 2017 00:15
-
-
Save sbalay/7015b52b635d9edf6223a16e60526228 to your computer and use it in GitHub Desktop.
Field level validations with redux-form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Field | |
name={'password'} | |
component={MyTextInput} | |
validate={[ | |
(val) => val ? undefined : 'Password field is required', | |
(val) => val && val.length >= 8 ? undefined : 'Password must be at least 8 characters long' | |
]} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment