question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug report]<FieldArray> fields.remove() forgot to remove SyncErrors

See original GitHub issue

Are 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:open
  • Created 4 years ago
  • Reactions:10
  • Comments:8

github_iconTop GitHub Comments

1reaction
ajain17commented, Jan 10, 2020

Same issue here. This is what the sync errors looks like after fields have been unregistered: image The keys need to be deleted from syncErrors when values are empty objects, null or undefined.

Please provide an update.

0reactions
truongnbvecommented, May 28, 2022

Finally setting forceUnregisterOnUnmount: true works for me https://stackoverflow.com/a/45132931

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found