Skip to content

Assign/get custom key value for useFieldArray #5134

@donysukardi

Description

@donysukardi

Is your feature request related to a problem? Please describe.
I'm using useFieldArray with controlled <Accordion> component from ant-design. Newly added entry would have to be expanded by default. In order to do that, I need to have the key value of the new entry to be added to Accordion state.

Describe the solution you'd like

  • Assign custom key value, or
  • Get assigned key value returned from append, prepend, etc.

Describe alternatives you've considered

  • I've managed to get it work by assigning custom key value with append({ uuid: 'xxx' }). However, I'm getting warning: useFieldArray fieldValues contain the keyName uuid which is reserved for use by useFieldArray.

Additional context
N.A.

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