Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

FieldRenderProps with React Native TextInput

$
0
0

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?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>