react-native-formik throws an error and doesn't work AT ALL with Formik v2
See original GitHub issueThis 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:
- Created 3 years ago
- Reactions:2
- Comments:6
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Ripplz Yes, you’re right, that was what was missing. Thanks!
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
initalValuesprop on your<Formik>component