react-hook-form
react-hook-form copied to clipboard
issue: resetField set option defaultValue not update form default value for that field
Version Number
^7.52.2
Codesandbox/Expo snack
lazy, I just want you to notify about the bug
Steps to reproduce
I tried reset({ ...getValues(), mySingleFormField: 'newDefaultValue' }), which work But when I try resetField('mySingleFormField', {defaultValue: 'newDefaultValue'}), it's not work. I can tell by console.log(defaultValues) from formState: {defaultValues}
Expected behaviour
resetField set 'newDefaultValue' as current field value AND update form's defaultValues to use 'newDefaultValue', so that next time when I call reset(), mySingleFormField will be reset back to 'newDefaultValue'
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct