在平面列表中显示来自多个状态的数据反应本机

display data from multiple state in flatlist react native

我正在从 firestore 的两个集合中获取数据。并在 componentDidUpdate() 中将数据设置为两个状态。现在我想将这些状态显示为平面列表数据作为平面列表的数据道具。我该如何实现?

在 FlastList 数据道具中,您可以发送类似 [...state1, ...state2]

<FlatList data={[...state1, ...state2]} renderItem={renderItem} />