I created custom TextInput for final-form in React-Native. And I need to specify type for FieldRenderProps. And I have an error:
TS2769: No overload matches this call. Overload 1 of 2, '(props: TextInputProps | Readonly<TextInputProps>): TextInput', gave the following error. Type '{ name: string; onBlur: (event?: FocusEvent<HTMLElement, Element> | undefined) => void; onChange: (event: any) => void; onFocus: (event?: FocusEvent<HTMLElement, Element> | undefined) => void; type?: string | undefined; value: TextInputProps; checked?: boolean | undefined; multiple?: boolean | undefined; }' is not assignable to type 'Readonly<TextInputProps>'.
So my CustomInput code:
import React, {FC} from 'react';import {FieldRenderProps} from 'react-final-form';import {TextInput, TextInputProps} from 'react-native';const AuthInput: FC<FieldRenderProps<TextInputProps>> = ({input}) => { return <TextInput {...input} />;};export default AuthInput;
Can you help, what type I need in FieldRenderProps?