【发布时间】:2021-06-11 20:29:13
【问题描述】:
我正在尝试从 firebase get 函数渲染数据,但它没有显示任何内容。图像 console.log 显示 2 个值,但不会在页面上呈现。有没有人建议为什么会这样。
function cards(){
store.collection('users').get().then(snapshot => {
images = snapshot.docs.map(doc => doc.data().image)
console.log(images)
return images.map((doc) => {
return (
<Card style={[styles.card, styles.card1]}>
<Text style={styles.label}>A</Text>
</Card>
)
})
})
}
return (
<View>
<View style={styles.viewport}>
<CardStack style={styles.content}>
{cards()}
</CardStack>
</View>
</View>
)
}
【问题讨论】:
标签: javascript arrays firebase google-cloud-firestore