title: bind(this) not working on ajax success function
body: <p>I use react and jQuery. here's a part of my code.</p>
  
  <p>Before react component mounts, I perform ajax request to know if user is logged in.</p>
  
  <p>It is supposed to set state when a response returns status code 200.<br>
  am I incorrectly using <code>bind(this)</code>?  </p>
  
  <pre><code>componentWillMount: function(){
    $.ajax({
       url: "/is_signed_in",
       method: "GET",
       dataType: "json"
    }).success(function(response){
      this.setState({ signedIn: response.signed_in, currentUser: $.parseJSON(response.current_user) });
    }.bind(this));
  },
  componentDidMount: function(){
    console.log(this.state.signedIn);
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Edit 01</strong></p>
  
  <p>when I do <code>console.log(this);</code> in <code>success(function(response){...})</code> callback.</p>
  
  <p><code>this</code> was the below.</p>
  
  <pre><code>R…s.c…s.Constructor {props: Object, context: Object, state: Object, refs: Object, _reactInternalInstance: ReactCompositeComponentWrapper}_reactInternalInstance: ReactCompositeComponentWrapper_context: Object_currentElement: ReactElement_instance: ReactClass.createClass.Constructor_isOwnerNecessary: false_isTopLevel: false_mountImage: null_mountIndex: 0_mountOrder: 2_pendingCallbacks: null_pendingElement: null_pendingForceUpdate: false_pendingReplaceState: false_pendingStateQueue: null_renderedComponent: ReactCompositeComponentWrapper_rootNodeID: ".0"_warnedAboutRefsInRender: false__proto__: ReactCompositeComponentWrappercontext: Object__proto__: Object__defineGetter__: __defineGetter__()__defineSetter__: __defineSetter__()__lookupGetter__: __lookupGetter__()__lookupSetter__: __lookupSetter__()constructor: Object()hasOwnProperty: hasOwnProperty()isPrototypeOf: isPrototypeOf()propertyIsEnumerable: propertyIsEnumerable()toLocaleString: toLocaleString()toString: toString()valueOf: valueOf()get __proto__: get __proto__()set __proto__: set __proto__()getDOMNode: ()__reactBoundArguments: null__reactBoundContext: ReactClass.createClass.Constructor__reactBoundMethod: ()arguments: (...)bind: (newThis )caller: (...)length: 0name: ""__proto__: ()[[TargetFunction]]: ()[[BoundThis]]: ReactClass.createClass.Constructor[[BoundArgs]]: Array[0]props: Objectrefs: Object__proto__: ObjectrenderButtonSet: ()setSignedIn: ()__reactBoundArguments: null__reactBoundContext: ReactClass.createClass.Constructor__reactBoundMethod: setSignedIn(response)arguments: (...)caller: (...)length: 1name: "setSignedIn"prototype: setSignedIn__proto__: ()&lt;function scope&gt;arguments: (...)bind: (newThis )arguments: (...)caller: (...)length: 1name: ""prototype: boundMethod.bind__proto__: ()&lt;function scope&gt;caller: (...)length: 1name: ""__proto__: ()[[TargetFunction]]: setSignedIn(response)[[BoundThis]]: ReactClass.createClass.Constructor[[BoundArgs]]: Array[0]state: ObjectcurrentUser: Objectcreated_at: "2015-07-24T18:30:38.772+09:00"email: "admin@gmail.com"facebook_account_url: nullfirstName: "유찬"github_account_url: nullgoogleplus_account_url: nullid: 1lastName: "서"linkedin_account_url: nullsns_avatar: nulltwitter_account_url: nullupdated_at: "2015-08-14T02:14:21.091+09:00"__proto__: ObjectsignedIn: true__proto__: Object__proto__: ReactClassComponent
  </code></pre>
  
  <hr>
  
  <p><strong>Solutions</strong><br>
  My code above was antipattern.<br>
  Follow one of the methods suggested by Answer i adopted. 
  Plus, React documentation already provided very useful solution about my case: <a href="https://facebook.github.io/react/tips/initial-ajax.html">Load Initial Data via AJAX</a></p>
  
  <p>Also, setState is asynchronous.<br>
  That's why I thought setState not working when I log it on console.<br>
  After all, i checked inside render and pass as props to child components.  </p>