-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Currently, useFieldArray removes the corresponding field array from the form's current values before unmounting. This is an issue for more complex forms where parts of the form are only mounted temporarily, e.g. being part of a dialog, drawer, tab, collapsable, etc.
The useField functions has a dedicated argument to prevent this behavior: keepValueOnUnmounted.
It would be great if useFieldArray would accept the same argument and give the user the option to opt-out of the remove-on-unmount behavior.
Thank you for your great work <3
Edit: My current workaround is to prevent the component from unmounting using <KeepAlive>
Metadata
Metadata
Assignees
Labels
No labels