Getting Started

image/svg+xml
Join the author of Final Form at ReactEurope to learn how to build Modern Forms in React

Getting Started

This library provides field array management functionality as a plugin mutator to Final Form.

Installation

npm install --save final-form final-form-arrays

or

yarn add final-form final-form-arrays

Usage

import { createForm } from 'final-form'
import arrayMutators from 'final-form-arrays'

// Create Form
const form = createForm({
  mutators: { ...arrayMutators },
  onSubmit
})

// push
form.mutators.push('customers', { firstName: '', lastName: '' })

// pop
const customer = form.mutators.pop('customers')

Mutators

Check out the API to see all the mutators provided.