From 0c084d5a7591956799c0b523bd686d874e9f92e7 Mon Sep 17 00:00:00 2001 From: Jascha Kanngiesser Date: Wed, 20 Jan 2021 21:36:29 +0100 Subject: [PATCH] Fix onRegionChangeComplete and restProps.mapRef is not a function --- lib/ClusteredMapView.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ClusteredMapView.js b/lib/ClusteredMapView.js index 9e44320..0d02a3d 100644 --- a/lib/ClusteredMapView.js +++ b/lib/ClusteredMapView.js @@ -143,10 +143,10 @@ const ClusteredMapView = forwardRef( } updateMarkers(markers); onMarkersChange(markers); - onRegionChangeComplete(region, markers); + onRegionChangeComplete && onRegionChangeComplete(region, markers); updateRegion(region); } else { - onRegionChangeComplete(region); + onRegionChangeComplete && onRegionChangeComplete(region); } }; @@ -177,7 +177,7 @@ const ClusteredMapView = forwardRef( ref={(map) => { mapRef.current = map; if (ref) ref.current = map; - restProps.mapRef(map); + restProps.mapRef && restProps.mapRef(map); }} onRegionChangeComplete={_onRegionChangeComplete} >