From 121680cbaa6bf289ec488183aa382e7c392b0de2 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Tue, 27 Sep 2022 18:19:41 -0400 Subject: [PATCH] fix --- web/components/usa-map/usa-map.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 (