score:5

Accepted answer

Move this.setState inside your db callback (if you put it outside it will be executed before the db call have finished)

componentDidMount() {
    const db = firebase.firestore();
    var turmarkers =[];

    db.collection("Markets").get().then((querySnapshot) => {
        querySnapshot.forEach((doc) => {        
            turmarkers.push(doc.data())

         });

        this.setState({
            mapdata:turmarkers
        });
    });    
}

Related Query

More Query from same tag