var App = React.createClass({
mixins: [ReactFireMixin],
getInitialState: function(){
return({items:[]});
},
componentWillMount: function() {
fb = new Firebase(this.props.url);
this.bindAsArray(fb, "data");
this.firebaseRefs[“data"]
.on("child_added", this.add.bind(this));
},
add: function(snapshot) {
this.setState({
items: this.state.items.concat([snapshot.val()])
});
},
render: function() {
return
{this.state.items.map(function(item){
return - {item}
})}
;
}
});
React.render(, document.body);