arrayOfIds.forEach((id) => {
firestore
.collection("foos")
.doc(id)
.get()
.then((foo) => {
fooArray.push(foo.data());
});
});
console.log(fooArray);
// some output
this.setState({ foos: fooArray });
// but nothing passed to the state
When I console.log fooArray I can see all the data but cant assign it to the state