sohobloo / react-native-modal-dropdown

A react-native dropdown/picker/selector component for both Android & iOS.
MIT License
1.19k stars 478 forks source link

How set object array as options instead if normal array #232

Open Monish-Coddle opened 4 years ago

Monish-Coddle commented 4 years ago

I have checked the example and found that we can set the object as options but not sure how to implement it. Can you please explain step by step how we can achieve it? A quick reply will be much appreciated.

dhruvjain10 commented 4 years ago

How I did it was by passing array of an objects in the options and using renderRow function-

here "option.label" is my object key. `renderRow={(option,index,isSelected)=>{
return(

{option.label}
                                    )                           
                            }}`

Sorry if answer was unformatted. I am new here