title: CORS request in react
body: <p>Getting this error when trying to get stuff from the Twitter API using <a href="https://github.com/danielhusar/simple-twitter" rel="nofollow">simple-twitter</a>:</p>
  
  <pre><code>XMLHttpRequest cannot load https://api.twitter.com/1.1/statuses/user_timeline.json. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 400
  </code></pre>
  
  <p>I'm basically doing exactly what it says in the <a href="http://facebook.github.io/react/tips/initial-ajax.html" rel="nofollow">react docs</a>, but with the relevant line replaced:</p>
  
  <pre><code>  componentDidMount: function() {
      twitter.get('statuses/user_timeline', function(error, data) {
        if(this.isMounted()){
          this.setState({tweets: data})
          console.dir('callback')
        }
      }.bind(this));
    }
  </code></pre>
  
  <p>The callback function seems to never fire, which I assume is due to the request not completing.</p>
  
  <p>What am I missing here?</p>