Skip to content

Commit

Permalink
Update state-management.md (#2422)
Browse files Browse the repository at this point in the history
The previous code example was misleading and it should be viewState instead of newCenter

Co-authored-by: Chris Gervang <[email protected]>
  • Loading branch information
The-Lone-Druid and chrisgervang committed Dec 19, 2024
1 parent f59c0fc commit d746ad7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/get-started/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}, [])

Expand Down

0 comments on commit d746ad7

Please sign in to comment.