Skip to content

Commit 170d6cc

Browse files
steveohstdavis
authored andcommitted
chore: correct hook usage types
1 parent a0d5c66 commit 170d6cc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/contexts/MapProvider.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { useGraphicManager } from '@ugrc/utilities/hooks';
44
import PropTypes from 'prop-types';
55
import { createContext, ReactNode, useState } from 'react';
66

7+
type GraphicOptions = Graphic | Graphic[] | null;
78
export const MapContext = createContext<{
89
mapView: MapView | null;
9-
setMapView: (mapView: MapView) => void;
10-
placeGraphic: (graphic: Graphic | Graphic[] | null) => void;
10+
setMapView: (mapView: MapView | null) => void;
11+
placeGraphic: (graphic: GraphicOptions) => void;
1112
zoom: (geometry: __esri.GoToTarget2D) => void;
1213
} | null>(null);
1314

@@ -25,7 +26,7 @@ export const MapProvider = ({ children }: { children: ReactNode }) => {
2526
mapView.goTo(geometry);
2627
};
2728

28-
const placeGraphic = (graphic: Graphic | Graphic[] | null): void => {
29+
const placeGraphic = (graphic: GraphicOptions): void => {
2930
setGraphic(graphic);
3031
};
3132

0 commit comments

Comments
 (0)