|
@@ -22,10 +22,16 @@ let Comment = React.createClass({
|
|
|
|
|
|
let CommentList = React.createClass({
|
|
let CommentList = React.createClass({
|
|
render: function () {
|
|
render: function () {
|
|
|
|
+ let commentNodes = this.props.data.map(function (comment) {
|
|
|
|
+ return (
|
|
|
|
+ <Comment author={comment.author} key={comment.id}>
|
|
|
|
+ {comment.text}
|
|
|
|
+ </Comment>
|
|
|
|
+ );
|
|
|
|
+ });
|
|
return (
|
|
return (
|
|
<div className="commentList">
|
|
<div className="commentList">
|
|
- <Comment author="Pete Hunt">This is one comment</Comment>
|
|
|
|
- <Comment author="Jordan Walke">This is *another* comment</Comment>
|
|
|
|
|
|
+ {commentNodes}
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|