interface FormValues {
friendEmail: string;
}
const initialValues: FormValues = {
friendEmail: \'\',
};
export const Page: React.FunctionComponent
I think there are a couple of issues in your codebase.
onChangeText={handleChange('friendEmail')}. It will trigger the handleChange while rendering the component not when you are actualy typing in the input box.handleChange function of Formik takes React.ChangeEvent instead of value. Check here . While onChangeText of react-native provides changed text of the input not event. Check hereYou can use setFieldValue function for this case:
{({
handleChange,
handleBlur,
handleSubmit,
isSubmitting,
values,
setFieldValue
}) => {
const setEmail = (email) => {
setFieldValue('friendEmail', email)
}
return (
-
)
}}
Please Note: I've never used formik with react-native. Just trying to connect the dots.