question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native-formik throws an error and doesn't work AT ALL with Formik v2

See original GitHub issue

This error comes when typing into any text field - TypeError: undefined is not an object (evaluating '(i === 0 ? obj : resVal)[pathArray[i]]')

This error occurs even with the example code in README.

It seems like work on react-native-formik stopped around the time the last stable version of Formik 1.x.x came out, which was 1.5.8, the package has not been updated for Formik v2

Right now it’s working with Formik@1.5.8, for anyone who wishes to use this package.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
alkaloxcommented, Oct 21, 2020

@Ripplz Yes, you’re right, that was what was missing. Thanks!

1reaction
Ripplzcommented, Oct 20, 2020

Okay, I’ve successfully reproduced this error in my Formik v2+ app, and I can confirm it’s what I mentioned above. You don’t need to downgrade your Formik, just include the initalValues prop on your <Formik> component

Read more comments on GitHub >

github_iconTop Results From Across the Web

<ErrorMessage /> | Formik
<ErrorMessage /> is a component that renders the error message of a given field if that field has been visited (i.e. touched[name] ===...
Read more >
Handling formik form when validation error occurs
A lifecycle event called when validation fails after an attempted submit (eg: onValidationError ), where i can access all the input validation ...
Read more >
Issues · bamlab/react-native-formik - GitHub
Set of helpers to make form awesome with React Native and Formik - Issues ... handleTextInput() throws error when not wrapped in Formik...
Read more >
Basic Errors - Formik for Beginners
Errors are a necessary part of all forms. Form requirements can range from very simple, to very complex. They range from simpler synchronous...
Read more >
Building and Validating Forms with Formik & Yup - YouTube
Build and Validate Forms with Formik & Yup [ React Native School] ... track, and display any server errors in your Formik form....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found