Skip to content

CyrilQuandalle/useForm

Repository files navigation

React hook to add form validation quickly

Here is an example of state schema to make it work

const stateSchema = {
  mail: {
    required: true,
    value: '',
    error: '',
    validator: {
      regEx: /^[a-z0-9]+([|.|-]{1}[a-z0-9]+)*@[a-z0-9]+([|.|-]{1}[a-z0-9]+)*[.]{1}[a-z]{2,6}$/i,
      error: 'Invalide email',
    },
  },
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors