简体   繁体   中英

I try to get data once from firestore but I recieve it thrice for each document in a collection

在此处输入图像描述

As I have mentioned in the code (in image) I try to get all documents for once but I get it thrice for each document.

  const docs = await db.collection("programs").get();
  docs.forEach((doc) => console.log(doc.data()));

I forgot to use componentDidMount in my component where I call this action creator. Now I fixed this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM