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