🏁 Final Form Set Field Touched

Mutator for setting a field as "touched" in 🏁 Final Form.
Installation
npm install --save final-form-set-field-touched
or
yarn add final-form-set-field-touched
Usage
import { createForm } from 'final-form'
import setFieldTouched from 'final-form-set-field-touched'
const form = createForm({
mutators: { setFieldTouched },
onSubmit
})
form.mutators.setFieldTouched('firstName', true)
form.registerField(
'firstName',
fieldState => {
const { touched } = fieldState
},
{
touched: true
}
)
Mutator
Sets the specified field's touched
flag to the boolean value provided.