【发布时间】:2020-08-09 16:25:39
【问题描述】:
我正在从 firestore 的两个集合中获取数据。并在 componentDidUpdate() 中将数据设置为两种状态。现在我想将这些状态显示为 flatlist 数据作为 flatlist 的数据道具。我怎样才能做到这一点?
【问题讨论】:
标签: firebase react-native react-native-flatlist
我正在从 firestore 的两个集合中获取数据。并在 componentDidUpdate() 中将数据设置为两种状态。现在我想将这些状态显示为 flatlist 数据作为 flatlist 的数据道具。我怎样才能做到这一点?
【问题讨论】:
标签: firebase react-native react-native-flatlist
在 FlastList 数据道具中,您可以发送类似 [...state1, ...state2] 的内容
<FlatList data={[...state1, ...state2]} renderItem={renderItem} />
【讨论】: