final-form / react-final-form-arrays

A component for rendering and editing arrays 🏁 React Final Form
MIT License
205 stars 70 forks source link

Typescript: useFieldArray second argument (config) should be optional #104

Closed Yankovsky closed 5 years ago

Yankovsky commented 5 years ago
export function useFieldArray<
  FieldValue = any,
  T extends HTMLElement = HTMLElement
>(
  name: string,
  config: UseFieldArrayConfig<FieldValue>
): FieldArrayRenderProps<FieldValue, T>

config should be optional, right? Just like in react-final-form. Readme clearly states

The useFieldArray hook takes two parameters, the first is the name of the field, and the second is an optional object that looks just like FieldArrayProps, except without the name. It returns an object just like FieldArrayRenderProps.

I'll make a pr.

erikras commented 5 years ago

Published fix in v3.1.1.