FieldArray inner fields not updating values after reset
See original GitHub issuePlease consider asking the question at our spectrum channel.
https://spectrum.chat/react-hook-form
Describe the question?
First of all, I wanted to thank you for creating this awesome library. I created a project a few months earlier, leave it there, and now that I came back to do some updates I’m amazed by the huge progress this library has made.
I’m not sure if this is a bug or it’s by design, and I couldn’t find any other issue for this specific problem.
When calling reset on the form to set a new state for the inputs, I’ve notice that the array field inputs doesn’t behave as any other regular input. Regular inputs update their value automatically, but for field arrays you have to use defaultValue={field.value} in order to get it to update.
I was hoping those field could behave just as the rest would.
To Reproduce Steps to reproduce the behavior:
- Go to code sandbox
- Click on ‘reset values’ button
The field array get’s populated with two inputs, as defined by the object passed to reset, but their values are empty.
The regular input outside the array works as expected.
Codesandbox link Include a codesandox will help us to investigate the issue quicker. https://codesandbox.io/s/field-array-not-loading-values-from-reset-sc3bx
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)

Top Related StackOverflow Question
Thank you for quick answer - right - it works, didn’t get that we were talking about ‘
defaultValue’ in input field (focusing ondefaultValueinuseFrom()). Yet, I still having problem with my code and Material UI TextField component - trying to reproduce - I will post it today.@dariusz-acai for questions please post at spectrum.