Generally
allows you to type even when you\'re just specifying a placeholder. However, when using within the Formik form, I am unable to type
In your case if your TextInput
returns value at first parameter like you use all right. But you mistake give name
to field:
<TextInput
name="friendEmail"
placeholder="Email"
onChangeText={setEmail}
autoCapitalize="none"
/>
Formik
doesn't know where to set your value if you don't give name to field.
And also you can do like:
<TextInput
name="friendEmail"
placeholder="Email"
onChangeText={(val) => {
setFieldValue('friendEmail', val)
setFieldTouched('friendEmail', true, false);
}
autoCapitalize="none"
/>
My advice is to modify or write wrapper for TextInput
. And field should return onChange
first parameter name
, and second value
. It will be more useful.
And you can read more about your problem on official docs.