Closed vonovak closed 6 years ago
Hi @vonovak:
It definitely make sense to make API look similar to standard RN Picker API. I have merged the same.
Thanks for the effort and PR.
Thanks </ Pranav >
@prscX would you mind doing another release? Thanks.
Motivation:
Currently, the
onSelection
function gets called with the index of item that was selected. As a programmer, I often will have to use the index to derive what was actually pressed: I usually do not care about the index that was pressed but about the value that the index represents. That is also the reason why the RN's pickeronValueChange
function look like this:onValueChange={(itemValue, itemIndex) => this.setState({language: itemValue})}
, not passing only index but also the value.I have added docs that indicate people can pass value for each item and the value will be the second param of the
onSelection
function. This is not a breaking change.