Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Created June 3, 2019 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luandevpro/b9ca3db8675e5d519d6281b24674ca9f to your computer and use it in GitHub Desktop.
Save luandevpro/b9ca3db8675e5d519d6281b24674ca9f to your computer and use it in GitHub Desktop.
import React from 'react';
import { View, TextInput as Input, Text } from 'react-native';
import { ErrorMessage } from 'formik';
export default function TextInput(props) {
console.log(props);
return (
<View>
<Input
onChangeText={props.form.handleChange(props.field.name)}
onBlur={props.form.handleBlur(props.field.name)}
value={props.field.value}
/>
<ErrorMessage
name={props.field.name}
render={msg => (
<View style={{ color: 'red' }}>
<Text>{msg}</Text>
</View>
)}
/>
</View>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment