import * as React from 'react'; import { TextInput, TextInputProps, View, Text } from 'react-native'; import styles from './style'; export interface InputProps extends TextInputProps { maxLength?: number; showCount?: boolean; } const Input: React.FC & { TextArea?: (p: TextAreaProps) => React.ReactElement | null; } = props => { return ; }; export interface TextAreaProps extends InputProps { rows?: number; } const TextArea: React.FC = props => { const { value, maxLength, showCount, rows = 3 } = props; return ( {showCount ? ( {value?.length || 0}/{maxLength || 0} ) : null} ); }; Input.TextArea = TextArea; export default Input;