Provide a way to disable merging of `defaultValues` into submission results
See original GitHub issueIs your feature request related to a problem? Please describe.
V7 introduced a new feature to merge defaultValues
into submission result.
This would break the logic for many use cases including dynamically generated fields. If the defaultValue includes mobileNumbers[3]
and the user delete that particular mobile number, the submission results would include the number that user intended to delete which renders the deletion useless.
Describe the solution you’d like
A way to disable the merging by default. At the moment, I cannot keep using V7 because there is absolutely no way to extract the actual state of the form. Because defaultValues
is canceling all the deletions.
Describe alternatives you’ve considered
Since getValues
, watch
, and handleSubmit
is also affected, there is no way to extract the actual data. If there is an alternative, I can’t see it.
Additional context I understand users voted for this feature, but I think it does more harms than good. Merging the result is such an easy thing that users would be able to make a decision themselves and implement it in their code. I don’t really think the library should be in charge of making this decision. At least there should be a way to disable it.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:39 (38 by maintainers)
Going to do an RFC on this one after
shouldUnregister
, my purpose is to have a config atuseForm
to turn on and off the behavior.let me know your guys’ early thoughts on this.
Hey @bluebill1049, Sorry I was looking at the wrong part of the doc. It is actually wokring properly. Thank you