Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 840 Bytes

getting-started.md

File metadata and controls

40 lines (27 loc) · 840 Bytes

This documentation is meant to be read on final-form.org. Links may not work on Github.com.

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.