

children?: ((props: FieldArrayRenderProps) => React.Node) | React.NodeįieldArrayRenderProps, as well as any non-API props Provide one of the ways to render: component, render, or children. The current used version of 🏁 React Final Form Arrays. UseFieldArray is used interally inside FieldArray. It returns an object just like FieldArrayRenderProps. 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. FieldArray : React.ComponentTypeĪ component that takes FieldArrayProps and renders an The following can be imported from react-final-form-arrays.

There are three ways to tell what to render: Method React Beautiful DnD Exampleĭemostrates how to integrate the simple example with react-beautiful-dnd Rendering fields.update: (index: number, value: any) => voidĭemostrates how to use to render an array of inputs, as well as.fields.swap: (indexA: number, indexB: number) => void.fields.move: (from: number, to: number) => void.

fields.map: (iterator: (name: string, index: number) => any) => any.fields.insert: (index: number, value: any) => void.fields.forEach: (iterator: (name: string, index: number) => void) => void.validate?: (value: ?any, allValues: Object) => ?any.isEqual?: (allPreviousValues: Array, allNewValues: Array) => boolean.render?: (props: FieldArrayRenderProps) => React.Node.children?: ((props: FieldArrayRenderProps) => React.Node) | React.Node.
