prscX / react-native-bottom-action-sheet

React Native: Native Bottom Action Sheet
Apache License 2.0
633 stars 48 forks source link

add value param to the grid and sheet views #12

Closed vonovak closed 6 years ago

vonovak commented 6 years ago

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 picker onValueChange 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.

prscX commented 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 >

vonovak commented 6 years ago

@prscX would you mind doing another release? Thanks.

prscX commented 6 years ago

Hi @vonovak: I have pushed the release with V0.0.9. Can you please download and verify the same.

Let me know in case you face any issues.

Thanks </ Pranav >