title: How do I use the window object in ReactJS?
body: <p>I want to load the <a href="https://github.com/google/google-api-javascript-client" rel="noreferrer">Google APIs client library</a> inside my <code>index.html</code> and the <code>onLoad='someMethod'</code> will invoke a method in a separate javascript file. That method will then print out to the console.</p>
  <p>The client library is loaded without any problems but the message is not getting printed out the console and I think it's because the method is not getting invoked at all.</p>
  <p>Here is my <code>index.html</code>:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;Welcome&lt;/title&gt;
  
      &lt;link href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot; integrity=&quot;sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7&quot; crossorigin=&quot;anonymous&quot;&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;div id=&quot;app&quot;&gt;&lt;/div&gt;
      &lt;script src=&quot;lib/vendors.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;build/bundle.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://apis.google.com/js/client.js?onload=handleGoogleClientLoad&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Here is the javascript file that contains the <code>handleGoogleClientLoad</code> method:</p>
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  
  import {Button} from 'react-bootstrap';
  
  class MyApp extends React.Component {
  
  handleGoogleClientLoad() {
      console.log('Success on load');
  }
  
  render() {
      return (
          &lt;div&gt;
              &lt;Button&gt;Click Me&lt;/Button&gt;
          &lt;/div&gt;
      );
    }
  }
  
  
  const app = document.getElementById('app');
  
  ReactDOM.render(&lt;MyApp /&gt;, app);
  </code></pre>
  <p>If this was plain javascript the method would look like this:</p>
  <pre><code>window.handleGoogleClientLoad = function() {
    // Log to the console
  };
  </code></pre>
  <p>Is there anything in es6 that is similar to the <code>window</code> object.</p>