DEV Community

Discussion on: (Part 1) Build quality forms with React 🚀

Collapse
 
titandiaz profile image
Cristian Diaz

How to get data from the entries in the registration form?

Collapse
 
alarid profile image
Yohann Legrand

It depends when and where you want to retrieve the form data ? In my example, you don't need to. You get access to the data in the submit handler, once the validation process is completed. If you need to listen to changes of a specific value, you can use hook-form's watch, as mentionned in the article. Also, at any time, you can use getValues: react-hook-form.com/api/useform/ge... (pay attention to the rules)