diff --git a/docs/get-started/state-management.md b/docs/get-started/state-management.md index 7b0a7e289..3cd564a1c 100644 --- a/docs/get-started/state-management.md +++ b/docs/get-started/state-management.md @@ -80,7 +80,7 @@ function App() { const newCenter = [viewState.longitude, viewState.latitude]; // Only update the view state if the center is inside the geofence if (turf.booleanPointInPolygon(newCenter, GEOFENCE)) { - setViewState(newCenter); + setViewState(viewState); } }, [])