title: Google Calendar API gapi.client.init in create-react-app throws error
body: <p>I am trying to adapt the code from the Google Calendar browser <a href="https://github.com/gsuitedevs/browser-samples/blob/master/calendar/quickstart/index.html" rel="nofollow noreferrer">quickstart</a> to work in my React app. Whenever I try to run the gapi.client.init method, it throws this error:</p>
  
  <pre><code>Refused to display 'https://developers.google.com/static/proxy?usegapi=1&amp;jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.MDhkA3012xc.O%2Fam%3DQQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCM6WmePnR12kdbRAwKb1aCuIQXH1Q%2Fm%3D__features__#parent=http%3A%2F%2Flocalhost%3A3000&amp;rpctoken=1847815717' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
  </code></pre>
  
  <p>I put all my code below. I made sure to whitelist my origin. I don't know if it has to be something besides <a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a></p>
  
  <pre><code>import React, { Component } from 'react';
  import config from '../../config';
  
  class Index extends Component {
    componentDidMount() {
      window.gapi.load('client:auth2', function() {
        window.gapi.client.init({
          apiKey: config.apiKey,
          discoveryDocs: config.discoveryDocs,
          clientId: config.clientId,
          scope: config.scope
        });
      });
    }
    login() {
      console.log('logging in...');
      window.gapi.auth2.getAuthInstance().signIn();
    }
    render() {
      return (
        &lt;div&gt;
          &lt;button type="button" onClick={this.login.bind(this)}&gt;Login with Google&lt;/button&gt;
        &lt;/div&gt;
      )
    }
  }
  
  export default Index;
  </code></pre>