Skip to content

Refactor/loginform react hook form zod

refactored LoginForm.tsx to replace manual validation logic with react-hook-form and Zod. Removed all useState-based error handling and inline regex validations. Introduced a centralized validation schema in src/schemas/loginForm.ts using Zod and integrated it with react-hook-form using zodResolver. This makes the form cleaner, more maintainable, and fully type-safe while keeping the UI unchanged.


Type of Change:

  • Bug Fix
  • Feature Development
  • Documentation

Testing:

  • Tested on desktop
  • Tested on mobile
  • Tested in different browsers

Screenshots (if applicable):

Screenshot_from_2026-04-16_11-44-23

Screenshot_from_2026-04-16_11-44-39

Screenshot_from_2026-04-16_12-35-25

Screenshot_from_2026-04-16_12-40-16


Checklist:

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • TypeScript types are correct_
Edited by Swarna rathna madhuri Kanda

Merge request reports

Loading