Last active
May 1, 2021 09:43
-
-
Save akshay-nm/beca138f1c676d724c2ad8ef60bf9fbc to your computer and use it in GitHub Desktop.
use-form-state configuration for a login form
This file contains hidden or 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
const config = { | |
states: [ | |
{ | |
name: 'email', | |
default: '', | |
defaultIsValid: false, | |
mustBeValid: true, | |
validator: () => true | |
}, | |
{ | |
name: 'password', | |
default: '', | |
defaultIsValid: false, | |
mustBeValid: true, | |
validator: (val) => val.length > 5 | |
} | |
], | |
debug: true // (optional property) if you want logs | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment