Formik: How to update values from a FieldArray onChange

Created on 26 Nov 2018  ·  3Comments  ·  Source: formium/formik

❓Question

I'm wondering how to update values when using a FieldArray. I have the values coming through, but how to I make onChange work?

Thank you.

Question

Most helpful comment

You should use setFieldValue.

All 3 comments

same here...
example project: https://codesandbox.io/s/ox047lvn4y

You should probably set the value using setFieldValue when using custom fields so in @Evanion's case: form.setFieldValue(field.name, value).

You should use setFieldValue.

Was this page helpful?
0 / 5 - 0 ratings