RFDropdown.js
import {Dropdown} from 'react-native-material-dropdown'; import PropTypes from 'prop-types'; import React from 'react'; import { TextInput, Text, View } from 'react-native'; import styles from './styles'; const RFDropdown = ({ input: { onBlur, onChange, onFocus, value }, meta: { error, touched, valid }, disabled, data, }) => ( <View style={{width:"100%"}}> <Dropdown data ={data} onBlur={onBlur} onChangeText={onChange} onFocus={onFocus} editable={!disabled} useNativeDriver={true} selectTextOnFocus={!disabled} value={value} style={[ styles.rootInput, { paddingLeft:10, color: disabled ? 'gray' : 'black', borderColor: !valid && touched ? 'red' : 'gray' }, ]} /> {!valid && touched && <Text style={styles.rootError}>{error}</Text>} </View> ); export {RFDropdown};