Skip to content

Commit

Permalink
chore: correct hook usage types
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh authored and stdavis committed Nov 14, 2024
1 parent a0d5c66 commit 170d6cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/contexts/MapProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { useGraphicManager } from '@ugrc/utilities/hooks';
import PropTypes from 'prop-types';
import { createContext, ReactNode, useState } from 'react';

type GraphicOptions = Graphic | Graphic[] | null;
export const MapContext = createContext<{
mapView: MapView | null;
setMapView: (mapView: MapView) => void;
placeGraphic: (graphic: Graphic | Graphic[] | null) => void;
setMapView: (mapView: MapView | null) => void;
placeGraphic: (graphic: GraphicOptions) => void;
zoom: (geometry: __esri.GoToTarget2D) => void;
} | null>(null);

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

const placeGraphic = (graphic: Graphic | Graphic[] | null): void => {
const placeGraphic = (graphic: GraphicOptions): void => {
setGraphic(graphic);
};

Expand Down

0 comments on commit 170d6cc

Please sign in to comment.