score:5

Accepted answer

you have to control your state like below:

var app = react.createclass({
    getinitialstate: function(){
        return {
            names: [],
            isloaded: false
        }
    },
    componentdidmount: function() {
        $.get(url, function (data) {
            this.setstate({ 
                names: data,
                isloaded: true
            })
        }.bind(this));
    },
    render: function() {
        return(
            <div>
                {this.state.isloaded ? <graph names={this.state.names}/> : <div>still loading... </div> }
            </div>
        )
    }
});

so once you get all your data you can render your chart otherwise show the loading screen. take a look at this link probably it will be helpfull for you. hope it makes sense for you.


Related Query

More Query from same tag