-
-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
FieldArray removing item gives old array from props #2934
Comments
@nirvparekh
|
I'm using class based component and this is Formik's props, not parent component props that we put under |
Whether you're using functional or class-based components, the values within You can rewrite your component like the following. Note that I haven't used class components in a while, so I wrote the child component functionally. However, you can achieve the same thing with class components if you like.
|
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days |
馃悰 Bug report
Current Behavior
I'm implementing invoice module in my app. where user can add invoice items dynamically handled by Formik's FieldArray. User can add/remove items.
When user removes a particular index from FieldArray, it removes from array and reflected in DOM. working fine. But after arrayHelper.remove(), Formik props
props.values.invoice_items
still giving old array in console.Expected behavior
after arrayHelper.remove(), Formik props
props.values.invoice_items
should give updated array.Reproducible example
Here's my snippet
Your environment
The text was updated successfully, but these errors were encountered: