final-form / final-form/react-final-form-arrays
Should the type of FieldArrayRenderProps['fields']['length'] be non-optional?
Open
- Dominant language
- TypeScript
- Stars
- 210
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
Currently `FieldArrayRenderProps.fields` gets `length` from `FieldState` where it is optional: `length?: number`. From the code, it looks like it is expected to always be a `number`. With it being optional you end up needing to do things like `fields.length && fields.length > 1` if you want to see if there's more than one field. If you agree, I'd be happy to submit a PR
Contributor guide
Assessment
This issue has not been assessed yet.