brianRingler / time-distance-tracker

https://time-distance-tracker.vercel.app
0 stars 1 forks source link

add react-hook-form register component #7

Closed imaricodes closed 1 year ago

imaricodes commented 1 year ago

I made a temporary route called 'register2' and a component called RegisterForm2 so that you can compare the standard form to the form using react-hook-form. Turns out they are very similar!

Primary differences:

  1. I moved the handleSubmit function to the Form component instead of the page
  2. All state management is in the RegisterForm2 component.
  3. prevent.Default is not needed with react-hook-form
  4. no need to create FormData object as react-hook-form handles this behind the scenes

In RegisterForm2, my comments explain the differences.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
time-distance-tracker ✅ Ready (Inspect) Visit Preview Sep 5, 2023 4:55pm