title: react-google-maps: how to use fitBounds API in the parent component
body: <p>I reproduce my issue in this live demo:
  <a href="https://codesandbox.io/s/p3yv83o7x7" rel="nofollow noreferrer">https://codesandbox.io/s/p3yv83o7x7</a></p>
  
  <p>Simple speaking, in the following code: </p>
  
  <pre><code>class MapWrapper extends React.Component {
    constructor() {
      super();
      this.state = {
        zoom: 8,
        strictMode: false
      };
      this.mapRef = null;
  
      this.onMapMounted = this.onMapMounted.bind(this);
      this.setZoom = this.setZoom.bind(this);
      this.setStrictMode = this.setStrictMode.bind(this);
      this.handleClick = this.handleClick.bind(this);
    }
  
    setZoom() {
      this.setState({ zoom: this.mapRef.getZoom() });
    }
  
    onMapMounted(ref) {
      this.mapRef = ref;
    }
  
    setStrictMode(e) {
      this.setState({ strictMode: e.target.checked });
    }
  
    handleClick() {
      // Here I want the map fit a new bound
      // With mapRef reference I can call fitBounds, it ok
      // But how I can create a new bounds object with new google.map.LatLngBounds()?
      // how I can access google lib here?
      //this.mapRef.fitBounds()
    }
    render() {
      return (
        &lt;div&gt;
          &lt;button onClick={this.handleClick}&gt;abc&lt;/button&gt;
          &lt;MyMapComponent
            isMarkerShown={this.state.zoom &lt; 10}
            onZoomChanged={this.setZoom}
            onMapMounted={this.onMapMounted}
            zoom={this.state.zoom}
          /&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  
  <p>my confusing point is marked in the <code>handleClick</code> function as comment. In this callback function, I want to use the google map <code>mapRef</code> reference to  call <code>fitBounds</code> API. But in order to run this API, I need to make a new <code>LatLngBounds</code> object with <code>new google.map.LatLngBounds()</code>. But how I can access google lib in the parent component? That's my confusing point</p>