Skip to content

Instantly share code, notes, and snippets.

@chrisbodhi
Created March 1, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbodhi/b542f089515831cf0d66 to your computer and use it in GitHub Desktop.
Save chrisbodhi/b542f089515831cf0d66 to your computer and use it in GitHub Desktop.
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