Closed dk253 closed 3 years ago
You can use the defaultValues param in useForm hook and pass in the data there if you have the data before loading of the form, but i guess in your case you are getting data after the loading of the form you can use reset method and pass the values in it.
const {reset} = useForm();
Thank you so much for your response! I think I solved it a different way. I'm using the "setValue" function from react-hook-form. I was just about to add this to this issue. Thanks for your patience!
Please forgive me if this is obvious, but I cannot figure it out.
I'm using a hook to grab a user's profile from a database and I'd like to prefill the form from the returned data. How do I load that data into the form for the user to change?
Thanks for this, BTW... Great library.