import * as React from 'react'; import { TextInput, View, Pressable, ViewStyle } from 'react-native'; import styles from './style'; import Icon from '../icon'; export interface InputProps { clearButtonMode?: string; clearBtnStyle?: ViewStyle; value?: string; onClear?: () => void; onChangeText?: (text: string) => void; [restProps: string]: any; } const Input: React.ForwardRefRenderFunction = (props, ref) => { const { clearButtonMode, value, clearBtnStyle } = props; const clearClick = () => { if (props.onChangeText) { props.onChangeText(''); } if (props.onClear) { props.onClear(); } }; return ( {clearButtonMode && clearButtonMode !== 'never' && value && value.length > 0 ? ( ) : null} ); }; export default React.forwardRef(Input);