import React, { forwardRef } from 'react'; import { KeyboardTypeOptions, StyleProp, StyleSheet, TextInput, ViewStyle, View, } from 'react-native'; import { Text } from 'native-base'; interface InputFieldProps { placeholder?: string; value?: string; style?: StyleProp; onChangeText?: (text: string) => void; keyboardType?: KeyboardTypeOptions; selectTextOnFocus?: boolean | undefined; errorText?: string; maxLength?: number; accessibilityLabel?: string; flex?: number; } export const InputField = forwardRef( ( { placeholder, value, style, onChangeText, accessibilityLabel, maxLength, keyboardType, errorText, ...restProps }, ref, ) => { return ( {errorText ? {errorText} : null} ); }, ); const styles = StyleSheet.create({ textInput: { backgroundColor: 'white', borderWidth: 1, borderColor: '#ccc', paddingVertical: 10, paddingHorizontal: 24, fontSize: 16, borderRadius: 5, }, errorText: { color: '#ff0000', }, });