the array will be like that [{ id: 1, name: 'coton'}] how to set label and value to be the name and this is my code

<DropDownPicker
    uniqueKey="id"
    displayKey = 'name'
    items={AllMaterial}
    containerStyle={{ height: 30, marginTop: 7 }}
    style={{ backgroundColor: 'rgba(237, 237, 237, 1)' }}
    labelStyle={{
    fontSize: 9.17,
    fontWeight: '700',
    lineHeight: 12.19,
    textAlign: 'left',
    color: 'rgba(0, 0, 0, 1)',
   }}
   arrowStyle={{ margin: -8 }}
   dropDownStyle={{ backgroundColor: 'white' }}
   onChangeItem={item => setChoosenMaterial(item)}
/>
1

There are 1 best solutions below

0
On BEST ANSWER

No you cant use that array of objects as [{id:1,name:'India'}], you have to modify that array by array and convert the objects to have key of [{id:1,name:'India',value:1,label:'India'}].

this will be displayed then .

if you have more queries do inform :D