react-native-picker-select: item construct?

138 views Asked by At

Is there any way to put an abject in the label of item?

<RNPickerSelect 
/* bunch of attributes*/
// the standard object
 items={[ {label:'1 hour', value:'1'},
           {label:'2 Hours', value:'2'},
                ...]}
// what I want to do
items={[
 { label:()=> {<><Icon name='clock' size={20}/><Text>1 Hour</Text></>},
   value:'1'},
    ...]}
 />

The problem as of the docs is that label accepts only string type. so, is there any prop or a way to put a complex object in label instead of a string?

0

There are 0 answers