When using both defaultVaules
and values
, useFrom returns actual values with delay.
#11398
Labels
enhancement
New feature or request
Discussed in https://github.com/orgs/react-hook-form/discussions/11397
Originally posted by t1m0n January 15, 2024
Hello!
I have a typical situation when I fetch some data and pass this data to the
useForm
. I also havedefaultValues
set along withvalues
. The problem is that when my request is loaded I show the page with a form and it displaysdefaultValues
for a moment and replaces them with actual data after.Even if using sync data,
useForm
anyway for a moment usesdefaultValues
instead ofvalues
Example
Live example - https://stackblitz.com/edit/stackblitz-starters-lkabsa?file=src%2FApp.tsx
The code above firstly logs
name default
and aftername current
.So the question is, is where anyway to get
values
in the first place if bothdefaultValues
andvalues
are set?Thank you!
The text was updated successfully, but these errors were encountered: