为什么react-native-modal-dropdown不是键/值属性?
我正在尝试在项目中添加一个下拉模式,但这有一个奇怪的行为。我们可以处理键/值吗?
我有以下数据来自我的操作
const properties = {
'1': 'Property 1',
'2': 'Property 2',
'3': 'Property 3',
};
我试图在模式下拉菜单中使用它
<ModalDropdown
defaultIndex={this.state.CurrentPropertyID}
options={properties}
onSelect={(value) => this.onChangeProp(value)}
/>
该想法将具有更新CurrentPropertyID状态的功能:
onChangeProp(value){
this.setState({
CurrentPropertyID: obj
});
这有意义吗?
谢谢
答案 0 :(得分:1)
两种选择:
AnotherSpecialList