我正在尝试在React-native中渲染ListItem中的某些项目。 这是我的数据:
[
{
"meetingname": "Jithin",
"meetingcreatedon": [
"May 02 2019 10:16:24"
],
"meetingstatus": "ontime",
"meetingcreatedby": "qvgahjvdsg",
"meetingparticipants": "",
"meetingid": "tyxasirhunxirty",
"meetingtime": "2012-00-20 00:00:00"
},
{
"meetingname": "Jithin",
"meetingcreatedon": [
"May 02 2019 10:16:24"
],
"meetingstatus": "ontime",
"meetingcreatedby": "qvgahjvdsg",
"meetingparticipants": "",
"meetingid": "tyxasirhunxirty",
"meetingtime": "2012-00-20 00:00:00"
}
]
这是我呈现列表项的功能
componentDidMount(){
getAllMeetingService().then(data=> {
this.meetingData.push(data[0]);
Alert.alert(typeof this.meetingData)
Alert.alert(JSON.stringify(this.meetingData));
})
}
render(){
return (
<View>
<OfflineNotice />
{
this.meetingData.map((meeting, i)=>(
<ListItem
key= {i}
title= {meeting.meetingname}
subtitle= {meeting.meetingtime}
></ListItem>
))
}
</View>
)
}
但是似乎没有任何东西可以显示Listitem。我尝试使用一些虚拟值,该值可以渲染? 我在这里做什么错了?