react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.45k stars 273 forks source link

No overload matches this call. Missing children prop on interface? #481

Open leoamato10 opened 1 year ago

leoamato10 commented 1 year ago

I'm having this msg:

Screenshot 2023-03-06 at 20 44 47

No overload matches this call. Overload 1 of 2, '(props: PickerProps<{}> | Readonly<PickerProps<{}>>): Picker<{}>', gave the following error. Type '{ children: any; dropdownIconColor: string; selectedValue: {}; onValueChange: (especialidad: any) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Picker<{}>> & Readonly<PickerProps<{}>>'. Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Picker<{}>> & Readonly<PickerProps<{}>>'. Overload 2 of 2, '(props: PickerProps<{}>, context: any): Picker<{}>', gave the following error. Type '{ children: any; dropdownIconColor: string; selectedValue: {}; onValueChange: (especialidad: any) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Picker<{}>> & Readonly<PickerProps<{}>>'. Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Picker<{}>> & Readonly<PickerProps<{}>>'.

Could it be that its missing the children property on PickerProps interface from Picker.d.ts?

I added children: React.ReactNode[] | React.ReactNode; to solve it. Should I do a pr?