diff --git a/web/components/usa-map/usa-map.tsx b/web/components/usa-map/usa-map.tsx index 0e07c2ac..208ee16f 100644 --- a/web/components/usa-map/usa-map.tsx +++ b/web/components/usa-map/usa-map.tsx @@ -7,7 +7,7 @@ import { USAState } from './usa-state' export type ClickHandler = ( e: React.MouseEvent ) => R -export type GetClickHandler = (stateKey: string) => ClickHandler +export type GetClickHandler = (stateKey: string) => ClickHandler | undefined export type CustomizeObj = { fill?: string clickHandler?: ClickHandler @@ -62,9 +62,7 @@ export const USAMap = ({ const fillStateColor = (state: string) => customize?.[state]?.fill ? (customize[state].fill as string) : defaultFill - const stateClickHandler = (state: string) => - customize?.[state]?.clickHandler - + const stateClickHandler = (state: string) => customize?.[state]?.clickHandler return (