From 70949465c94d416910a807b6c25ead5bb874ae5d Mon Sep 17 00:00:00 2001 From: Zahid Shaikh <53161242+The-Lone-Druid@users.noreply.github.com> Date: Fri, 9 Aug 2024 19:01:31 +0530 Subject: [PATCH] Update state-management.md The previous code example was misleading and it should be viewState instead of newCenter --- docs/get-started/state-management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } }, [])