html form using react-hook-form (register), yup and yup resolver with shared html controls and validations.
- react-hook-form, yup and yup resolver third partly libraries are using to handle the form state.
- These libraries provide rich set of features to handle the form events/values/states/validations etc.
- The form has been created with shared input controls and third party library.
- react-hook-form library is being used to handle the form values.
Install: npm install react-hook-form
- yup library is being used to handle the form validations and model/schema.
Install: npm i yup
- yup resolver is being used to handle yup with react-hook-form library. It acts as a middleware.
npm i @hookform/resolvers
- Shared HTML conrtols:
components/controls/CheckBox.tsx, components/controls/DropDownList.tsx, components/controls/Input.tsx, components/controls/RadioGroup.tsx
- Employee Page:
components/pages/Eomployee.tsx