I'm having problems setting the initialValue of a FieldArray
component in React Final Form. It works when I set it on the Form
component, but not on the FieldArray
. Please see below CodeSandbox examples:
On FieldArray: https://codesandbox.io/s/react-final-form-field-arrays-vq9pz
On Form: https://codesandbox.io/s/react-final-form-field-arrays-v90nn
I would prefer to have it set on the FieldArray, which seems like it should be possible if I look at the documentation here. Has anyone else come across this?
Usually I will create a mutator like this:
and change the Add Customer button
onClick={() => form.mutators.addCustomer()}