danish1658 / react-native-dropdown-select-list

☝️ React Native Select List Equivalent to Html's Select with options"
https://www.npmjs.com/package/react-native-dropdown-select-list
MIT License
200 stars 89 forks source link

Capture both key and value #25

Closed myt-sheila closed 1 year ago

myt-sheila commented 1 year ago

Hello! Can I ask how can I capture both the key and value? Thank you! 🙏

omercandemir commented 1 year ago

Hi, if you just need the key when I examined SelectList.tsx, I saw this structure and this is how I solved my own problem.

if(save === 'value'){ setSelected(value); }else{ setSelected(key) } You can get the key when you replace the save props with any value other than value. If I have free time I can work on capturing both values. Good work.

Bobo-amg commented 1 year ago

Both key and value would be great!

danish1658 commented 1 year ago

Approved for implementation