/** @jsx React.DOM */ // FeatureList // Feature // - name // - status // - description // - button-edit // - button-delete // - toggle-status // FeatureForm // StrategyList // Strategy // StrategyForm var FeatureList = React.createClass({ getInitialState: function() { return { features: [] }; }, componentDidMount: function () { reqwest("/features").then(this.setFeatures); }, render: function () { var featureNodes = this.state.features.map(function (feature) { return ( ); }); return (
{featureNodes}
); }, setFeatures: function (data) { this.setState({features: data.features}); } }); var Feature = React.createClass({ // TODO: validate props? handleStatusChange: function (event) { console.log(event); }, render: function () { return (

{this.props.feature.name}

{this.props.feature.description}


); } }); React.renderComponent( FeatureList(null), document.getElementById('content') );