sacred-roseS
Refine3y ago
2 replies
sacred-rose

Hello everyone I just want to understand

Hello everyone.. I just want to understand something but IDK if this is the right channel or should I use discussions.. if not right channel let me know..
In react-hook-form in useForm function, why don't you directly declare defaultValues  in the useHookForm in this line, rather use useEffect to go over the fields and set the values? (in line #L130. Since defaultValues can be undefined, just setting queryResult?.data?.data solves the problem.

If I set it that way, I can use useFieldArray properly in my code, now I have to jump some hoops to clearly reflect the fields. Is there a specific reason not to use that, maybe I am missing something?
Was this page helpful?