您需要两个组件:评论和评论。
Comment = React.createClass({ render: function(){ var comment = this.props.comment; return <div> <p>{comment.author} says {comment.comment_text}</p> <Comments comments={comment.children} /> </div> }});Comments = React.createClass({ render: function(){ return <div> {this.props.comments.map(function(comment){ return <Comment key={comment.id} comment={comment} /> }) </div> }});Comment呈现注释,而后者又可以呈现Comment节点等。这将递归地构建注释结构。



