I\'m new to reactjs, I want to fetch data in server, so that it will send page with data to client.
It is OK when the function getDefaultProps return dummy data like
As a supplement of the answer of Michael Parker, you can make getData accept a callback function to active the setState update the data:
componentWillMount : function () { var data = this.getData(()=>this.setState({data : data})); },