【发布时间】:2017-11-01 03:04:58
【问题描述】:
所以我这里有一个这样的数组
[{"facebook":"https://facebook.com"}, {"instagram":"https://instagram.com"}]
现在我想将键显示为图标名称,将值显示为 href 链接。
socials.map((social, index) => {
return(
<View key={index}>
<Icon name={social.facebook} onPress={() => {}} />
</View>
);
})
如何在不选择特定键名的情况下将键分配给图标名称? 谢谢。
【问题讨论】:
标签: javascript reactjs react-native