1 parent 9336017 commit c9816d5Copy full SHA for c9816d5
1 file changed
examples/Tornado-example/static/js/CommentList.jsx
@@ -0,0 +1,21 @@
1
+import React from 'react';
2
+import Comment from './Comment.jsx';
3
+
4
+class CommentList extends React.Component {
5
+ render() {
6
+ if (!this.props.comments.length) {
7
+ return null;
8
+ }
9
+ var commentNodes = this.props.comments.map((comment, index) => {
10
+ return <Comment author={comment.author} text={comment.text} key={index} />;
11
+ });
12
+ return (
13
+ <div>
14
+ <h2>Comments</h2>
15
+ {commentNodes}
16
+ </div>
17
+ );
18
19
+}
20
21
+export default CommentList;
0 commit comments