beefe / react-native-picker

A Native Picker with high performance.
1.75k stars 785 forks source link

Typescript typings are wrong for `onPicker*` functions #414

Open tbrent opened 4 years ago

tbrent commented 4 years ago

This issue is about onPickerConfirm, onPickerCancel, and onPickerSelect.

It looks like the typings here are wrong. InPickerTest, there are examples where the callbacks receive the index of the selected value. However, this is not reflected in the typescript typings. Instead, they show:

onPickerConfirm?(item: any[]): void
...
onPickerCancel?(item: any[]): void
...
onPickerSelect?(item: any[]): void

I believe the correct typings should be of the form onPickerConfirm?(item: any[], index?: number): void.