我试过__CODE__等等但是没有一个在哪里工作正常.任何人都可以建议我__CODE__从设备存储中选择文件.
我在我的应用程序中使用了材料下拉列表
<Dropdown
baseColor='white'
itemColor='white'
label='Select Cluster'
/>
Run Code Online (Sandbox Code Playgroud)
我像这样获取JSON对象,它工作正常.
fetch('url', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
username : "admin"
})
}).then((response) => response.json())
.then((responseJson) => {
var count = Object.keys(responseJson.message.Obj).length;
for(var i=0;i<count;i++){
console.log(responseJson.message.Obj[i].name) // I need to add
//these names to dropdown
}
})
.catch((error) => {
console.error(error);
});
Run Code Online (Sandbox Code Playgroud)
现在我需要将
responseJson.message.Obj[i].name值添加到我的下拉列表中.
javascript react-native react-native-android react-native-ios