You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you take a look at the interface, the second type argument is never used. Therefore it's useless. I think that it should be removed however it would be breaking change since the generic interface might be already used with 2 arguments in other projects. Removing the second type argument would cause error TS2314: Generic type 'FieldArrayRenderProps ' requires 1 type argument(s)..
exportinterfaceFieldArrayRenderProps<FieldValue,TextendsHTMLElement>{fields: {forEach: (iterator: (name: string,index: number)=>void)=>voidinsert: (index: number,value: FieldValue)=>voidmap: <R>(iterator: (name: string,index: number)=>R)=>R[]move: (from: number,to: number)=>voidupdate: (index: number,value: FieldValue)=>voidname: stringpop: ()=>FieldValuepush: (value: FieldValue)=>voidremove: (index: number)=>FieldValueshift: ()=>FieldValueswap: (indexA: number,indexB: number)=>voidunshift: (value: FieldValue)=>voidvalue: FieldValue[]}&FieldState<FieldValue[]>meta: Partial<{// TODO: Make a diff of `FieldState` without all the functionsactive: booleandirty: booleandirtySinceLastSubmit: booleanerror: anyinitial: anyinvalid: booleanpristine: booleansubmitError: anysubmitFailed: booleansubmitSucceeded: booleantouched: booleanvalid: booleanvisited: boolean}>}
The text was updated successfully, but these errors were encountered:
Are you submitting a bug report or a feature request?
TS typing dead code
What is the current behavior?
interface FieldArrayRenderProps
requires 2 generic arguments however the second one is unused.What is the expected behavior?
interface FieldArrayRenderProps
requires only one generic argument which represents value type.Sandbox Link
https://codesandbox.io/s/react-final-form-field-arrays-forked-7wuwcb?file=/index.tsx
What's your environment?
Other information
When you take a look at the interface, the second type argument is never used. Therefore it's useless. I think that it should be removed however it would be breaking change since the generic interface might be already used with 2 arguments in other projects. Removing the second type argument would cause error
TS2314: Generic type 'FieldArrayRenderProps ' requires 1 type argument(s).
.The text was updated successfully, but these errors were encountered: