1

I used TextInput in react-native-paper. But when I followed their documentation,but show errors. enter image description here

Show the error like:

Type '{ label: string; value: string; onChangeText: (text: string) => void; }' is missing the following properties from type 'Pick<TextInputProps, "allowFontScaling" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "defaultValue" | ... 116 more ... | "dense">': children, onPressIn, onPressOut, autoCompletets(2739)

versions:

"react": "16.13.1",
"react-native": "0.63.3",
"react-native-config": "^1.4.1",
"react-native-fast-image": "^8.3.4",
"react-native-paper": "^4.11.2",
"react-native-vector-icons": "^9.1.0"

used react native cli and not expo cli.

  • 1
    strange I'm trying the same code and works fine no type error, did you try to reinstall the package ?, even the type error should be on text inised onchangetext beacuse it should tell you the text already used before – Hamed Mar 10 '22 at 05:41
  • Yep. Thank you. I also think same. It is typescript error. – Ravindu Hirimuthugoda Mar 10 '22 at 06:40

1 Answers1

0

Try this:

<TextInputPaper 
     autoComplete={false}
     label="Email"
     value={text}
     onChangeText={(text: string) =>
        setText(text)
     }
/>

I faced same type issue and when i add autoComplete={false} it gone

Rahman Haroon
  • 1,088
  • 2
  • 12
  • 36