[bug report]<FieldArray> fields.remove() forgot to remove SyncErrors
See original GitHub issueAre you submitting a bug report or a feature request?
bug report
What is the current behavior?
I have a <FieldArray name="items"> of 2 items, say Item1 and Item2. After I remove Item2, the Items values changed to only Item1, which is good, however, syncErrors are not updated accordingly
What is the expected behavior?
when fields.remove
is invoked, syncError should be uploaded as well, along with value
Sandbox Link
should be easy to reproduce. didn’t create a sandbox for that
What’s your environment?
8.2.6
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:8
Top Results From Across the Web
syncErrors still persist in state after fields have been ... - GitHub
When the fields are unmounted and unregistered, they should also be removed from syncErrors because they stop the form from being submitted ...
Read more >How do you get syncErrors out of state using redux-form ...
I'm trying to figure out how to use a selector to return all of the syncError values to an Error manifest component that...
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
Same issue here. This is what the sync errors looks like after fields have been unregistered:
The keys need to be deleted from syncErrors when values are empty objects, null or undefined.
Please provide an update.
Finally setting
forceUnregisterOnUnmount: true
works for me https://stackoverflow.com/a/45132931