【发布时间】:2019-04-28 10:05:58
【问题描述】:
我用 querySnapshot 填充了一个数组,但 flatlist 没有呈现任何内容
试图更改renderItem代码
constructor(props) {
super(props);
var rootref = firebase.firestore().collection("deneme");
var wholeData = []
rootref.get().then(function(querySnapshot){
querySnapshot.forEach(function(doc) {
wholeData.push(doc.data())
});
});
};
render() {
return (
<View>
<FlatList
data={this.wholeData}
renderItem={({item}) => <Text>{item.isim}, {item.soyisim}</Text>}
/>
</View>
);
};
【问题讨论】:
标签: react-native google-cloud-firestore