Open arjunlandes opened 4 years ago
Ping. It actually must be a problem with withNextInputAutoFocusForm
or withNextInputAutoFocusInput
, since handleTextInput
works fine on its own.
Edit: Was getting the same bug. Seems like this issue is arising because react-native-formik hasn't been updated for Formik v2. react-native-formik currently works well with Formik@1.5.8 and all the other versions before that.
Downgrading Formik to 1.5.8 got it working :)
I use this library with Formik v2.1.5 on my React Native app (Expo), and it works just fine.
From the error message, I think this has to do with an upgrade made in Formik v2^, which requires you to provide a value for each of your form elements in an object passed to your Formik component's initialValues
prop.
Try this and see if it would work.
Originally posted by @Ripplz in https://github.com/bamlab/react-native-formik/issues/146#issuecomment-712866563
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.
I'm basically using the demo Gist verbatim:
https://snack.expo.io/@almouro/react-native-formik-gist
When I type a single letter into any text field I get the error:
I tried removing validationSchema and I still got the error. Separately, I tried removing withNextInputAutoFocusForm and withNextInputAutoFocusInput, and still got the problem. It feels like a bug in handleTextInput. Maybe I'm doing something stupid in the syntax below.
From
package.json
:Code: