formik icon indicating copy to clipboard operation
formik copied to clipboard

Performance wise Formik not good

Open AkshayGadekar opened this issue 4 years ago • 3 comments

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.

AkshayGadekar avatar Nov 06 '21 14:11 AkshayGadekar

Probably fixed by #3231

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

johnrom avatar Nov 08 '21 15:11 johnrom

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.

lyin-vir avatar Dec 23 '21 18:12 lyin-vir

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

paul-vd avatar Sep 08 '22 17:09 paul-vd

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

edishu avatar May 15 '23 02:05 edishu