Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

backbone.reactive

0.0.5 • Public • Published

Backbone.Reactive

Meet plugin for Backbone.js family, which allows to combine powerful Backbone.js with React.js views.

Plugin supports AMD, as well as CommonJS. So feel free to use it with require.js

Usage

define(["react", "backbone", "backbone.reactive"], function(React, Backbone, Reactive) {
  "use strict";
  
  var model = new Backbone.Model({name: "Andrew"});
  var MyReactiveComponent = new Backbone.Reactive({
    render: function() {
        return (
            <div>
                <span>{this.getModel().get('name')}</span>
            </div>
        );
    }
  });
  
  var ReactiveView = React.createFactory(MyReactiveComponent);
 
  var view = ReactiveView({
      model: model
  });
 
  var renderTarget = document.getElementById('myEl');
  
  // render view
  React.render(view, renderTarget);
 

install

npm i backbone.reactive

Downloadsweekly downloads

2

version

0.0.5

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar