react-google-maps: how to use fitBounds, panBy, panTo, panToBounds public APIs?
According to the React Google Maps library , you can call these four methods from the ref object. What seems weird, is that these methods are supposed to receive two parameters, a map instance and other arguments, like so: fitBounds(map, args) { return map.fitBounds(...args); } However, when calling fitBounds() this way, nothing happens on the map, no bounds are changed and no errors are thrown. This is the way I have structured the component, calling fitBounds in componentDidUpdate: import React from 'react' import { withGoogleMap, GoogleMap, InfoWindow, Marker, OverlayView } from 'react