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:
I moved the handleSubmit function to the Form component instead of the page
All state management is in the RegisterForm2 component.
prevent.Default is not needed with react-hook-form
no need to create FormData object as react-hook-form handles this behind the scenes
In RegisterForm2, my comments explain the differences.
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:
In RegisterForm2, my comments explain the differences.