Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var Dealer = React.createClass({
loadCardInfoFromServer: function() {
$.ajax({
url: this.props.url,
dataType: 'json',
success: function(data) {
this.setState({data: data});
}.bind(this),
error: function(xhr, status, err) {
console.error(this.props.url, status, err.toString());
}.bind(this)
});
},
getInitialState: function() {
return {data: []};
},
render: function() {
return (
this.loadCardInfoFromServer(),
<Deck data={this.state.data} />
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.