-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering form with array of objects #151
Comments
Quick solution is to pick unique input names. In this particular situation, I would pick names such as When processing values I would convert from flat list into nested structure. |
my input names do use unique names if formik would use |
Something similar to this would be great https://redux-form.com/7.0.4/docs/api/fieldarray.md/ |
My input names do use unique name |
I actually created pull request to remedy this #202 . Do you think it will cover all cases? For both arrays and nested values? |
Merged with #207 |
I have the following problem:
I'm trying to render multiple input fields based on index such as:
where
values
contains an array of objects as:and
getInputFields(index)
renders a set of input fields based on the education index.The problem im running into is that if i use the default
handleChange
from formik, thevalues
object i get is:So i decided to implement a custom onChange handler that uses the
setFieldValue
to manually seteducation
. It works up to a point. Now myerrors
andtouched
objects are not working. Errors return the exact same object as before:Is there a special way to handle a form with an array of objects?
Will this feature be implemented anytime soon in formik?
The text was updated successfully, but these errors were encountered: