react-native-picker-select
react-native-picker-select copied to clipboard
Using react-native-vector-icons throws TypeScript error: "TS2769: No overload matches this call"
Describe the bug
After upgrading my app to use react-native 0.69.1, all places where I used react-native-vector-icons (following this example) in my app now throws the error reproduced below;
TS2769: No overload matches this call.
Overload 1 of 2, '(props: PickerSelectProps | Readonly<PickerSelectProps>): Picker', gave the following error.
Type '() => JSX.Element' is not assignable to type 'ReactNode'.
Overload 2 of 2, '(props: PickerSelectProps, context: any): Picker', gave the following error.
Type '() => JSX.Element' is not assignable to type 'ReactNode'.
XYZSelector.tsx(96, 16): Did you mean to call this expression?
XYZSelector.tsx(96, 16): Did you mean to call this expression?
To Reproduce
Steps to reproduce the behavior:
- Add
RNPickerSelectto a component - Using the
Iconprop, add an Icon like thisconst dropDownIcon = () => { return <Icon name="ios-chevron-down" size={20} />; }; - See error
Expected behavior
Using Icon as contained in the readme should not throw a type error. It was not throwing this error until I upgraded my react-native version to 0.69.1.
Screenshots

Additional details
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- react-native-picker-select version: [8.0.4]
Interestingly, this version (which came with a
yarn add react-native-picker-selectto upgrade the package) is missing from the releases list: latest release is8.0.3Screenshot from mypackage.json👇🏿
- react-native version: [e.g. 0.69.1]
- N/B: The package still works and I squelched the warning with
//eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore, however, that is not ideal as this probably points to a larger problem
Reproduction and/or code sample
Can't adequately reproduce this with an expo snack as: my project uses TypeScript and hence my root component is App.tsx as opposed to their more type-permissive JavaScript based App.js.
