【发布时间】:2017-10-02 19:09:40
【问题描述】:
【问题讨论】:
标签: firebase react-native firebase-realtime-database
【问题讨论】:
标签: firebase react-native firebase-realtime-database
您在正确的轨道上,但缺少.then() 与回调一起使用的检索部分:
var recentPostsRef = firebase.database().ref('/store');
recentPostsRef.once('value').then(snapshot => {
// snapshot.val() is the dictionary with all your keys/values from the '/store' path
this.setState({ stores: snapshot.val() })
})
firebase.database.Reference 文档中有很多很好的示例和解释可以提供帮助。
【讨论】: