我正在尝试使用 fetchFirestoreCollection 来检索集合,并继续得到“找不到集合”,所以看起来好像 .ts 文件中的某些内容可能已关闭?我可以成功登录应用程序,但无法从 Firestore 中检索。提前感谢!
代码如下;
var filters = [
['where', 'type', '==', 'news', 'string']
];
// @ts-ignore
const fetchHome = async() => {
// @ts-ignore
await FirebaseX.fetchFirestoreCollection('home',function(documents){
// @ts-ignore
setEntries(JSON.stringify(documents));
console.log("Successfully fetched collection: "+JSON.stringify(documents));
},
// @ts-ignore
function(error: string){
// @ts-ignore
console.error("Error fetching document: "+error);
});
}
useEffect(() => {
fetchHome().then(r => {});
console.log('entries: ', entries);
}, []);