Hello,
I have a problem with overlayView - a property mapPanes becomes null when a component is rerendered (by incoming items that create new overlayViews) and i am still giving this error message:
TypeError: Cannot read property 'overlayMouseTarget' of null
from react-google-maps/lib/utils/OverlayViewHelper in mountContainerElementToPane
Here is my code:
const clusterMarkers = cluster && cluster.map((x, key) => <OverlayView
position={{ lat: x.lat, lng: x.lng }}
mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET}
getPixelPositionOffset={getPixelPositionOffset}
key={key}
>
<div onClick={...}>
{x.title}
</div>
</OverlayView>);
<GoogleMap
ref={setMap}
center={c}
zoom={z}
onZoomChanged={zoomChangedHandler}
onDragEnd={centerChangedHandler}
>
{clusterMarkers}
</GoogleMap>
Please, do you have any idea to fix it?
I am using v6.0.0
I found the answer - the overlay key was not unique.
Doesn't fix it for me...
Add a random uuid to every key prop and change it every rerendering..
this solves the error messages BUT causes flickering on any setState that rerenders the map.
Did anyone come up with any solutions?
+1
+1
Please refer to Getting Help section in the README (or #469).
Most helpful comment
this solves the error messages BUT causes flickering on any setState that rerenders the map.