Created
June 3, 2019 13:10
-
-
Save luandevpro/b9ca3db8675e5d519d6281b24674ca9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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