formik icon indicating copy to clipboard operation
formik copied to clipboard

TypeScript Support for `ArrayField`

Open alperen opened this issue 2 years ago • 0 comments

Feature request

Hello everyone,

Current Behavior

As far as I looked, ArrayField component doesn't have TypeScript support for its array utils.

image

Desired Behavior

Have type safety on array utils

Suggested Solution

We can supply type safety by passing type of the array into ArrayField like:

<FieldArray<Fact> name="facts">
  {children}
</FieldArray>

Who does this impact? Who is this for?

It will be the users who use TypeScript. It will help us to sure all data that we use is type-safed.

Describe alternatives you've considered

I have no alternatives. Open to discuss.

Additional context

I don't know Formik codebase deeply therefore I don't have enough information about thats feature can be done or not. But, I think that it will be good feature for Formik community. I would like to handle it as possible as I can

alperen avatar Sep 02 '22 12:09 alperen