Skip to content

Instantly share code, notes, and snippets.

@akshay-nm
Last active May 1, 2021 09:43
Show Gist options
  • Save akshay-nm/beca138f1c676d724c2ad8ef60bf9fbc to your computer and use it in GitHub Desktop.
Save akshay-nm/beca138f1c676d724c2ad8ef60bf9fbc to your computer and use it in GitHub Desktop.
use-form-state configuration for a login form
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