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

react-native/Typescript: how to pass autoComplete value to TextInput as the parent component prop? What's the correct type?

$
0
0

Consider I have a custom component like this with a TextInput inside (for example a modal input dialog):

interface Props {    ...    autoComplete: string;}const ModalInputDialog = (props: Props) => {    ...    return (<TextInput autoComplete={props.autoComplete} ... />);};

The Typescript compiler complains that "No overloads matches this call". The problem is that I don't know which is the correct type for the autoComplete property. It isn't string.

By inspecting TextInput It seems that there a big object called TextInputAndroidProps, but It doesn't work either.

Which is the correct type I'm searching for?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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