import React, { forwardRef } from "react"; import { KeyboardTypeOptions, NativeSyntheticEvent, TextInput as RNTextInput, TextInputContentSizeChangeEventData, TextInputProps, ViewStyle, } from "react-native"; import styledComponent from "../../utils/styledComponent"; import { View } from "../View"; import styles from "./styles"; export type InputProps = { autoFocus?: boolean; icon?: React.ReactNode; onBlur?: () => void; onChange?: (value: string) => void; onContentSizeChange?: ( e: NativeSyntheticEvent ) => void; onFocus?: () => void; placeholder?: string; value?: string | number; keyboardType?: KeyboardTypeOptions; multiline?: boolean; secureTextEntry?: boolean; style?: ViewStyle; dark?: boolean; disabled?: boolean; }; const StyledTextInput = styledComponent(RNTextInput); const Input = forwardRef( ( { icon, value, onChange, style, dark, disabled, ...props }: InputProps, forwardedRef ) => { const input = ( ); return icon ? ( {input} {icon} ) : ( input ); } ); export default Input;