Skip to content

joewkm/useInput-customHooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This simple project demonstrate simple reuse of React customs hooks on multiple input elements to refactor codes and reduce code cluttering.

User defined validation function can be pass to hooks to validate different input elements. In this case, simple email validation is demonstrated.

The following is demonstrated and compared between useState() and useReducer()

BasicForm.js, use-input.js : Uses useState() to manage state BasicForm2.js, use-input2.js : Uses useReducer() to manage state

About

Use of customs hooks to refactor and reduce code cluttering.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors