Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formik Uncaught TypeError: Cannot read property 'getFieldProps' of undefined

I am using Formik to create form. When I use FieldArray in one of the form I get error saying Field.tsx:81 Uncaught TypeError: Cannot read property 'getFieldProps' of undefined

To verify if I am doing something wrong, I copied example from documents and used it. Unfortunately, example from the docs didn't work. Any idea why it could go worong?

Here is the example I copied to my project and it didn't work: https://formik.org/docs/examples/field-arrays

like image 233
Pavan Kumar Avatar asked Feb 01 '26 09:02

Pavan Kumar


1 Answers

Finally, figured it out. I was getting the error because webpack/typescript in watch mode was not transpiling the changes properly. Restarting the webpack dev server fixed the problem.

like image 184
Pavan Kumar Avatar answered Feb 03 '26 23:02

Pavan Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!