Closed maurer2 closed 6 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-hook-form-website | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 16, 2024 4:25am |
Hello, it might be helpful to clarify how
values
anddefaultValues
work when both props are used with theuseForm
hook. This behaviour seems to have tripped up another user before. I observed the behaviour when usingdefaultData
to store default values andvalues
for storing the latest form values that were previously submitted. When trying to reset the form viareset
or resetting the field viaresetField
values
would be used as default values instead ofdefaultValues
unlessresetOptions: { keepDefaultValues: true }
was used.Cheers