From 5f773a48bea52bffe2d89494f8c4014d141e9fcc Mon Sep 17 00:00:00 2001 From: Zahid Shaikh <53161242+The-Lone-Druid@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:46:56 +0530 Subject: [PATCH] Update state-management.md (#2422) The previous code example was misleading and it should be viewState instead of newCenter Co-authored-by: Chris Gervang --- 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); } }, [])