Error : Cannot read property ‘map’ of undefined

First of all, set more safe initial data:

getInitialState : function() {
    return {data: {comments:[]}};

And ensure your ajax data.

It should work if you follow above two instructions like Demo.

Updated: you can just wrap the .map block with conditional statement.

if ( {
  var commentNodes = (comment){
      return (

Leave a Comment