jannikbuschke / formik-antd

Simple declarative bindings for Ant Design and Formik.
https://codesandbox.io/s/github/jannikbuschke/formik-antd-example
MIT License
590 stars 81 forks source link

Memory leak using Select #177

Closed JoFont closed 1 year ago

JoFont commented 3 years ago

Using any combination of the Select field from "formik-ant" results in a memory leak of some sorts. The select dropdown never opens and the app crashes. Using the SelectInput directly from Ant Design outside of a FormItem works fine but defeats the purpose of using this library.

<FormItem name="title" label="Title" className="col-span-2 md:col-span-1">
  <Select name="title" options={options} />
</FormItem>

Notes:

Thank you for your help.

JoFont commented 3 years ago

Follow up on this issue: downgrading Ant Design version to 4.1.0 from 4.11.2 seemed to work.

misterrPink1 commented 2 years ago

2022 update: I managed to resolve this by updating formik-antd and antd to their latest versions (2.0.4 and 4.22.6 respectively). Furthermore you need to check which version of React you are running. Some changes were made to React-DOM in React 18.1 that may cause some incompatibilities between React <> Formik-antd <> antd .

I first tried to downgrade antd, but this causes issues with React 18.