final-form / final-form/react-final-form-arrays

Fields names getter

Open
#143 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
210
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Hey, say I have this code:

```
type FormValues = {
x: [{id: number, value: string}]
}
```

```
const { fields } = useFieldArray(
"x",
{
isEqual,
// re-render uppon array values change
subscription: { value: true },
}
);
```

Now sometimes I don't need to use `fields.map`, say I want to render the item in the 5th cell, assuming I know it exists..

How would I get the prefix name of the cell? surely I can write "x[5].value", but I wanted something like ``${field.names[5]}.value`` also maybe instead of `fields.map`, make it `fields.names.map`

Great library, thank you for final-form & react-final-form & this plugin :),
looking forward for your response

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.