1
votes

I'm using Native base's Picker component and rendering using .map: Tried everything the Internet has suggested!! Didn't get it fixed yet

<Item rounded style={{marginBottom:20}}>
<Picker selectedValue={this.state.district} onValueChange={(val)=>this.setDistrict(val)}>
    <Picker.Item label='Select District' value='0'/>  
     {this.state.districtsList.map((item,index) => {
        return (<Picker.Item label={item.name} value={item.id} key={index+1}/>) //if you have a bunch of keys value pair
     })}
</Picker>
1

1 Answers

0
votes

Experiencing the same thing! You can use like this:

<SafeAreaView> Your code block </SafeAreaView>