I'm want to render data from firestore into my react component. I updated the global state array with firestore data and it's updating but when I'm going to render that array the array shows as undefined.

I have tried using redux and the same problem happened, now used reactn but same things are happening.

```
import React from "react";
import {setGlobal} from "reactn";
import ReactDOM from "react-dom";
import Apps from "./Apps";

setGlobal({  names:[],})

ReactDOM.render( <Apps/>, document.getElementById("root"))
ReactDOM.render(<Apps/>, document.getElementById("root"))`

-----App.js----------

import React from "reactn";
import db from "./firebase";

class Apps extends React.Component{

    componentDidMount(){
        db.collection("users").get().then((snapshot)=>{

            snapshot.forEach((doc)=>{

            const user=  {name:doc.data().name,
               weight:doc.data().weight,
             id:doc.id}
             this.global.names.push(user)
          })       
    })
}

render(){
        ///this show the data in names array of state
        console.log(this.global)
        //// this show undefind (its having data)
        console.log(this.global.names[0])
        return(
            ///but while rendering its not showing anything
            <div>{this.global.names.map((name)=>(
                <h1>weight is {name.weight} </h1>
            )
            )}</div>
        )
    }
}

export default Apps;

```