react-final-form-arrays icon indicating copy to clipboard operation
react-final-form-arrays copied to clipboard

Should the type of FieldArrayRenderProps['fields']['length'] be non-optional?

Open aaronjensen opened this issue 7 years ago • 0 comments

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

aaronjensen avatar Apr 19 '18 23:04 aaronjensen