TanStackT
TanStack2y ago
6 replies
popular-magenta

Field array validation not working correctly when field is removed

When a field array field is removed with a validation error on it, the field array that was +1 in the array shows the removed field's validation error, even tho the field previously did not have validation errors. It seems as tho validation is not running properly after an element is removed from the field array. I tried to call form.validateAllFields() after removing an element from the field array, but that leads to Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'errorMap') being thrown and not caught. Any advice on this?
Was this page helpful?