title: Ajax success issue with React and Rails
body: <p>I've got a form that I am trying to handle with React. This is the ajax method in the handleSubmit function:</p>
  
  <pre><code>$.ajax({
    data: formData,
    dataType: "json",
    url: '/requests',
    type: "POST",
    success: function(data, status, xhr) {
      console.log('SHOW HERE ON RESPONSE');
      this.setState({
        formSubmitted: true
      });
    }
  });
  </code></pre>
  
  <p>When I click on submit, I can see the POST request go through and the server responds with a 200. But the success callback is never entered, I don't see the console message.</p>
  
  <p>My rails controller's action is just a simple:</p>
  
  <pre><code>return render nothing: true, status: 200 if request.xhr?
  </code></pre>
  
  <p>The log with the server response includes:</p>
  
  <pre><code>Completed 200 OK in 11ms (Views: 2.5ms | ActiveRecord: 2.6ms)
  </code></pre>
  
  <p>However when I move the stuff from the success callback in the ajax request to a <code>complete</code> callback then I see this error in the console:</p>
  
  <pre><code>Uncaught TypeError: this.setState is not a function
  </code></pre>