Closed xconverge closed 1 year ago
@probablyup here is a small weird half-baked example that matches what I am seeing. If you revert the formik version, the text field updates fine.
Incase the codesandbox doesnt work:
// Helper styles for demo
import "./helper.css";
import React from "react";
import { render } from "react-dom";
import { Formik, Form, FieldArray } from "formik";
// Here is an example of a form with an editable list.
// Next to each input are buttons for insert and remove.
// If the list is empty, there is a button to add an item.
export const FriendList = () => (
<div>
<h1>Friend List</h1>
<Formik initialValues={{ friend: "" }} onSubmit={() => {}}>
{({ values, handleChange }) => (
<Form>
<FieldArray
name="friends"
//shouldUpdate={() => true}
render={(arrayHelpers) => (
<input
type="text"
id={`friend`}
name={`friend`}
value={values.friend}
onChange={handleChange}
/>
)}
/>
</Form>
)}
</Formik>
</div>
);
const App = () => <FriendList />;
render(<App />, document.getElementById("root"));
Fixing this in the next release, sorry about that.
@probablyup any ETA on this? Unfortunately both this and #3796 broke multiple forms within our apps
@probablyup any ETA on this? Unfortunately both this and #3796 broke multiple forms within our apps
You can see the status here, it looks all in progress and moving quickly https://github.com/jaredpalmer/formik/pull/3814
Bug report
Current Behavior
Parts of fieldarray don't update correctly after https://github.com/jaredpalmer/formik/pull/3784
Expected behavior
Fields update correctly
Reproducible example
https://codesandbox.io/s/formik-example-forked-zffjus
Suggested solution(s)
Additional context
For now I just added this to use the same behavior from previous versions
Your environment