bloggy
bloggy copied to clipboard
Why a component/JSX file to list up posts?
I see there is a component inside assets/javascripts
directory with following contents:
This thing breaks the $ rake assets:precompile RAILS_ENV=production
task due to the <
character inside JSX file:
/** @jsx React.DOM **/
var PostsList = React.createClass({
getInitialState: function() {
return { posts: this.props.initialPosts };
},
render: function() {
var posts = this.state.posts.map(function(post) {
return <Post key={post.id} post={post} />;
});
return (
<div className="posts">
{posts}
</div>
);
}
});