Open iamdey opened 2 years ago
This seems even more relevant now that final-form-arrays v3.1.0 sets the value to undefined
:
Change
remove
andremoveBatch
behavior to set array value to undefined when all items have been removed.
I was about to create an issue about this but then noticed this pull request. 🙂
@iamdey, IMO we should be adding a generic type too. I have a use case,
const {
fields: { value },
} = useFieldArray('options[0]');
Where value will now be { label: string; value: string }
, shouldn't we have a generic type too?
@erikras should I open a pull request? Without the proper type I have to enforce it manually 😞
I found that value is not always defined, I added tests as proof and improve typing as well.
@erikras, may I take the opportunity to ask if Final Form will be maintained ? I find the library pretty cool, there some flaws in the design (cf. issues on the react final form repository), and I recently made a long comparison for our form framework migration since redux-form is deprecated. I hope I can publish it soon. Long story short: coming from redux-form, Final Form is light-weight, fast, and easy to learn, it only miss popularity on github.