I have the following json:
{
\"comments\":[
{
\"id\":1,
\"comment_text\":\"asdasdadasdsadsadadsa\",
\"author\":\"adsfasdasdsad\",
You need two components: Comments and Comment.
Comment = React.createClass({
render: function(){
var comment = this.props.comment;
return
{comment.author} says {comment.comment_text}
}
});
Comments = React.createClass({
render: function(){
return
{this.props.comments.map(function(comment){
return
})
}
});
The Comment renders Comments, which in turn can render Comment nodes, etc. This recursively builds the comment structure.