import React from 'react' import { View, Text, TextInput, StyleSheet} from 'react-native' export default class Input extends React.Component { focus() { this.input.focus(); } blur() { this.input.blur(); } clear() { this.input.clear(); } isFocused() { return this.input.isFocused(); } render() { return ( {this.props.icon && ( {this.props.icon} )} this.input = ref} enablesReturnKeyAutomatically placeholderTextColor="#7e7d9a" /> {!!this.props.errorMessage && ( {this.props.errorMessage} )} ) } } const styles = StyleSheet.create({ container: { width: '100%', paddingHorizontal: 10, }, inputContainer: { flexDirection: 'row', borderBottomWidth: 1, borderBottomColor: '#47466f', }, input: { alignSelf: 'center', color: 'black', fontSize: 18, flex: 1, minHeight: 40, paddingHorizontal: 15, }, iconContainer: { height: 40, justifyContent: 'center', alignItems: 'center', marginLeft: 15, }, error: { marginVertical: 6, marginHorizontal: 8, fontSize: 12, fontStyle: 'italic', }, })