【发布时间】:2021-01-17 00:41:10
【问题描述】:
我正在使用 Native base 的 Picker 组件并使用 .map 进行渲染: 尝试了互联网建议的一切!还没解决
<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>
【问题讨论】:
标签: react-native warnings picker native-base