Skip to content

issue: UseFieldArray errors on form state after array field is unmounted #12680

@cgero-eth

Description

@cgero-eth

Version Number

7.54.2

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/angry-fermi-ssm9j8

Steps to reproduce

  1. Go to codesandbox link
  2. Click on Submit
  3. Both the text and array fields have errors
  4. Click on toggle text field
  5. The form-state is updated and there are no errors for the text field
  6. Click on toggle array
  7. Array field errors are still present on the form-state

Expected behaviour

Array field errors should not be present on form state when array field is not mounted. I could use the shouldUnregister parameter on the useArrayField hook but for my use case I need to keep the array values on the form when the array field is unmounted.

What browsers are you seeing the problem on?

Chrome

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions