Controller value reset after remove
See original GitHub issueDescribe the bug
Modified value of Controller in list (useFieldArray) is not preserved after calling remove, when the component use a complex value, like objects
To Reproduce Steps to reproduce the behavior:
- Go to codesandbox
- Click on append
- select an value in the select input, and an date in the date picker
- click on remove in the first value of the
useFieldArray - the values are gone
- see in the console that the component received another value( empty string or undefined)
Codesandbox link codesandbox
Expected behavior don’t lose values of the component
Obs: yes, this issue is similar to the issue #1172, but i am having this problem before, and this commit https://github.com/react-hook-form/react-hook-form/commit/1bfb7c10d6f09fc188c978eb4e9629af00d7b084 dont solved the problem
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (11 by maintainers)
Top Results From Across the Web
flutter - How do I reset my controller when I come back or finish?
You can use Get.reset() if you only have one controller. It clears all registered instances.
Read more >useForm - reset - React Hook Form
An optional object to reset form values, and it's recommended to provide the entire defaultValues when supplied. keepErrors, boolean. All errors will remain....
Read more >React Hook Form - Reset form with default values and clear ...
This is a quick example of how to reset a React Hook Form with default values and clear form validation error messages.
Read more >How to Reset the Integrated Dell Remote Access Controller ...
To reset the iDRAC to factory default values using the iDRAC Settings Utility. ... The system restarts after all iDRAC setting are set...
Read more >Fisher™ FIELDVUE™ DVC6200 Digital Valve Controller
D Restart Control Mode—This defines the Control Mode of the instrument after a restart (e.g. power cycle). Available choices are Resume Last, Analog...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Okay, i see that the CSB that i picked by template, use the name
testin theuseFieldArray, and when change this the date field works 👍🙏 you can submit a PR at our website repo! ❤️ if the doc is not having the correct example, feel free to update it and get your name on the contribution list 👍