Skip to content

Instantly share code, notes, and snippets.

@sbalay
Created January 26, 2017 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbalay/7015b52b635d9edf6223a16e60526228 to your computer and use it in GitHub Desktop.
Save sbalay/7015b52b635d9edf6223a16e60526228 to your computer and use it in GitHub Desktop.
Field level validations with redux-form
<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