Skip to content

Instantly share code, notes, and snippets.

@erikras
Last active December 3, 2017 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikras/2c19da03bb8a11fd4a6b219020576dba to your computer and use it in GitHub Desktop.
Save erikras/2c19da03bb8a11fd4a6b219020576dba to your computer and use it in GitHub Desktop.
🏁 Final Form Arrays
import { createForm } from 'final-form'
import arrayMutators from 'final-form-arrays'
// Create Form
const form = createForm({
mutators: {
// potentially other mutators here
...arrayMutators
},
onSubmit
})
// push
form.mutators.push('customers', { firstName: '', lastName: '' })
// pop
const customer = form.mutators.pop('customers')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment