title: Return error message in React
body: <p>I'm learning ReactJS. I'm looking the tutorial - <a href="http://facebook.github.io/react/docs/tutorial.html" rel="nofollow">http://facebook.github.io/react/docs/tutorial.html</a></p>
  
  <p>On submit the script read JSON from the server:</p>
  
  <pre><code>handleCommentSubmit: function(comment) {
      var comments = this.state.data;
      comments.push(comment);
      this.setState({data: comments}, function() {
        // `setState` accepts a callback. To avoid (improbable) race condition,
        // `we'll send the ajax request right after we optimistically set the new
        // `state.
        $.ajax({
          url: this.props.url,
          dataType: 'json',
          type: 'POST',
          data: comment,
          success: function(data) {
            this.setState({data: data});
          }.bind(this),
          error: function(xhr, status, err) {
            console.error(this.props.url, status, err.toString());
          }.bind(this)
        });
      });
    },
  </code></pre>
  
  <p>And update <code>data</code>. How can I send error message from JSON? Something like this:</p>
  
  <pre><code>&lt;Comment author={comment.author} key={index}&gt;
      {comment.text}
      &lt;div class="error"&gt;Error&lt;/div&gt;
  &lt;/Comment&gt;
  </code></pre>
  
  <p>Should I set it in <code>data</code>:
  <code>this.setState({[{name: 'John', text: 'text', error: 'error'}]});</code></p>
  
  <p>And change comments?:</p>
  
  <pre><code>&lt;Comment author={comment.author} key={index}&gt;
      {comment.text}
      &lt;div class="error"&gt;{comment.error}&lt;/div&gt;
  &lt;/Comment&gt;
  </code></pre>