Search code examples
reactjsformikformik-material-ui

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


Solution

  • 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.