Skip to content

Instantly share code, notes, and snippets.

@rchrd2
Created February 17, 2016 18:46
Show Gist options
  • Save rchrd2/9eadd9eae7ecf3e53d18 to your computer and use it in GitHub Desktop.
Save rchrd2/9eadd9eae7ecf3e53d18 to your computer and use it in GitHub Desktop.
Using React with Backbone
var HelloView = Backbone.View.extend({
initialize: function() {
this.listenTo(this.model, "change", this.render, this);
this.render();
},
render: function() {
var reactEl = React.createElement('div', {}, 'Hello, World!');
ReactDOM.render(reactEl, this.el);
return this;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment