Formik: Is touched prop run on react native?

Created on 8 Jan 2018  路  2Comments  路  Source: formium/formik

Questions:
Is touched prop run on react native?

Most helpful comment

@aligos I guess that code should do the work:

<TextInput
  onChangeText={(text) => setFieldValue('email', text)}
  value={values.email}
  onBlur={() => setFieldTouched('email')}
/>
{errors.email && touched.email &&
  <Text>Error!</Text>
}

All 2 comments

@aligos I guess that code should do the work:

<TextInput
  onChangeText={(text) => setFieldValue('email', text)}
  value={values.email}
  onBlur={() => setFieldTouched('email')}
/>
{errors.email && touched.email &&
  <Text>Error!</Text>
}

@artem-romanov But doing onBlur={() => props.setFieldTouched('fieldName')} makes my onSubmitEditing={props.handleSubmit} not working. On the web, upon pressing _"Enter"_ while I'm typing in the <Input /> field does submit the form no more with that onBlur.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dearcodes picture dearcodes  路  3Comments

jaredpalmer picture jaredpalmer  路  3Comments

jeffbski picture jeffbski  路  3Comments

jaredpalmer picture jaredpalmer  路  3Comments

green-pickle picture green-pickle  路  3Comments