jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.87k stars 2.78k forks source link

Performance wise Formik not good #3400

Open AkshayGadekar opened 2 years ago

AkshayGadekar commented 2 years ago

I am using formik for my signup form using material UI. That form only as four input text fields, as user fills up that form, when I console log form component rendering, it is in hundreds, on just one key stroke form component renders 3 times, if user types fast it takes time to reflect it in UI. Even for Blur event, it renders 3 times, finally I kept validateOnBlur: false to somehow optimize the form. But the point is for big forms, formik will definitely create performance issues, which I am afraid of. So I request formik team to please work on optimizing the performance, I love the library, performance is only big concern.

johnrom commented 2 years ago

Probably fixed by #3231

Edit: Don't thumbs down me for fixing it, when the owner never merged my fixes!! Meanies..

lyin-vir commented 2 years ago

I'm experiencing similar issues. I'm wondering if you used the FieldArray component. For me, the performance is fine when the form data is a flat object, but the rerender issue becomes significant when there's an array. Using validateOnBlur circumvents the issue but has a worse UX since the error won't go away unless the user deliberately clicks away from the field.

paul-vd commented 2 years ago

Same issue here with the FieldArray it literally becomes un-useable with material ui fields if you have 10 or more

edishu commented 1 year ago

Does Formik has something like FormSpy or subscriptions like react-final-form?