-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Version Number
7.65.0
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/ptdm7n
Steps to reproduce
- Go to https://codesandbox.io/p/sandbox/ptdm7n
- Click on Submit
- Notice the submit data coming from defaultValues
- Click on Reset
- Notice the same submit data coming from defaultValues
- Click on Reset again
- Notice the data passed to reset() is now showing
It seems that a single call to reset({}) doesn't work. A double call produces the expected result.
Expected behaviour
- Go to https://codesandbox.io/p/sandbox/ptdm7n
- Click on Submit
- Notice the submit data coming from defaultValues
- Click on Reset - reset({})
- The form defaultValues = {}
I'm not sure if the intention was different, but it seems logical that anything passed to reset(...) should now be the new defaultValues (if keepDefaultValues
option is not enabled)
What browsers are you seeing the problem on?
Chrome
Relevant log output
Submit {name: Object}
Reset using {}
Submit {name: Object}
Reset using {}
Submit {}
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels