Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix modal and LayoutAnimation conflicting issue #258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix modal and LayoutAnimation conflicting issue
  • Loading branch information
InKyoJeong committed Apr 28, 2023
commit 089f455940e76df998e0eabe5afb9747a4e42d82
15 changes: 10 additions & 5 deletions lib/ClusteredMapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
forwardRef,
} from "react";
import { Dimensions, LayoutAnimation, Platform } from "react-native";
import MapView, { Marker, Polyline } from "react-native-maps";
import MapView, { Polyline } from "react-native-maps";
import SuperCluster from "supercluster";
import ClusterMarker from "./ClusteredMarker";
import {
Expand Down Expand Up @@ -59,9 +59,10 @@ const ClusteredMapView = forwardRef(
const [clusterChildren, updateClusterChildren] = useState(null);
const mapRef = useRef();

const propsChildren = useMemo(() => React.Children.toArray(children), [
children,
]);
const propsChildren = useMemo(
() => React.Children.toArray(children),
[children]
);

useEffect(() => {
const rawData = [];
Expand Down Expand Up @@ -133,7 +134,11 @@ const ClusteredMapView = forwardRef(
const bBox = calculateBBox(region);
const zoom = returnMapZoom(region, bBox, minZoom);
const markers = superCluster.getClusters(bBox, zoom);
if (animationEnabled && Platform.OS === "ios") {
if (
animationEnabled &&
Platform.OS === "ios" &&
restProps.provider !== "google"
) {
LayoutAnimation.configureNext(layoutAnimationConf);
}
if (zoom >= 18 && markers.length > 0 && clusterChildren) {
Expand Down