Skip to content

Commit d746ad7

Browse files
Update state-management.md (#2422)
The previous code example was misleading and it should be viewState instead of newCenter Co-authored-by: Chris Gervang <[email protected]>
1 parent f59c0fc commit d746ad7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/get-started/state-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function App() {
8080
const newCenter = [viewState.longitude, viewState.latitude];
8181
// Only update the view state if the center is inside the geofence
8282
if (turf.booleanPointInPolygon(newCenter, GEOFENCE)) {
83-
setViewState(newCenter);
83+
setViewState(viewState);
8484
}
8585
}, [])
8686

0 commit comments

Comments
 (0)