We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
at()
1 parent 9f24e94 commit e4c16caCopy full SHA for e4c16ca
packages/maps/src/components/MapView.tsx
@@ -224,10 +224,10 @@ const MapViewF = <T extends object>({
224
() => getChildrenForType(MapMarkerCluster),
225
[getChildrenForType]
226
);
227
- const clusterView = React.useMemo(
228
- () => getChildrenForType(MapMarkerClusterView).at(0),
229
- [getChildrenForType]
230
- ); //Only take the first, ignore any others
+ const clusterView = React.useMemo(() => {
+ const clusterViews = getChildrenForType(MapMarkerClusterView);
+ return clusterViews.length ? clusterViews[0] : undefined; //Only take the first, ignore any others
+ }, [getChildrenForType]);
231
232
if (autoClusterMarkers) {
233
clusterMarkers(
0 commit comments