Skip to content

Use of customs hooks to refactor and reduce code cluttering.

Notifications You must be signed in to change notification settings

joewkm/useInput-customHooks

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

No packages published