You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
#### onRegionChangeComplete() callback is called infinitely
611
+
612
+
If changing the state in `onRegionChangeComplete` is called infinitely, add a condition to limit these calls to occur only when the region change was done as a result of a user's action.
613
+
614
+
```javascript
615
+
onRegionChangeComplete={ (region, gesture) => {
616
+
// This fix only works on Google Maps because isGesture is NOT available on Apple Maps
617
+
if (!gesture.isGesture) {
618
+
return;
619
+
}
620
+
621
+
// You can use
622
+
dispatch({ type:"map_region", payload: { mapRegion: region }}); // if using useReducer
623
+
// setMapRegionState(region); // if using useState
0 commit comments