I've been stuck on this issue for so long.
(我已经在这个问题上停留了很长时间。)
I just started implementing Firestore in my react-native application with react-native-firebase.(我刚刚开始使用react-native-firebase在我的react-native应用程序中实现Firestore。)
I'm just following the docs [ https://invertase.io/oss/react-native-firebase/v6/firestore/quick-start#reading-data] but it doesn't work for me.(我只是关注文档[ https://invertase.io/oss/react-native-firebase/v6/firestore/quick-start#reading-data],但它对我不起作用。)
This is in Android.
(这是在Android中。)
Haven't tested in iOS yet.(尚未在iOS中进行测试。)
I keep getting this error:
(我不断收到此错误:)
[TypeError: undefined is not a function (near '...this._firestore.native.collectionGet...')]
Here's the relevant code:
(以下是相关代码:)
import React, {Component} from 'react';
import { firebase } from '@react-native-firebase/firestore';
export default App extends Component{
constructor(props) {
super(props);
this.getData= this.getData.bind(this)
this.getData()
this.state = {};
}
async getData() {
try {
const querySnapshot = await firebase.firestore()
.collection('Gyms')
.get() //error with this
console.log('Documents', querySnapshot.docs);
} catch (e) {
console.log(e);
}
}
}
Any help would be much appreciated!
(任何帮助将非常感激!)
ask by Akshat Jain translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…