I am using React JS with Apollo client, when I want to create like a registration form for example, I usually create a div which contains some input fields and a button, the button is not of type "submit" it is just a regular button with an "onClick()" event that runs the registration function ... it does the job and I like the way the registration logic runs without passing any data through the URL as well as it doesn't need to refresh the page after each registration approach.
So the question is which way is better ?
- Using a form tag to do form things
- Using a div instead
NOTE: I know that there is some packages that can handle these situations like "Formik" for example ... but I like to code everything my self.