From 93682e9d13960f214dba77814384e3d1f5366e46 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Sat, 4 Feb 2023 20:29:50 +0100 Subject: [PATCH] Further type fixes --- src/utils/location/useMap.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/location/useMap.ts b/src/utils/location/useMap.ts index c4637a9a36..5cd7897069 100644 --- a/src/utils/location/useMap.ts +++ b/src/utils/location/useMap.ts @@ -21,7 +21,7 @@ import { createMap } from "./map"; interface UseMapProps { bodyId: string; - onError: (error: Error) => void; + onError?: (error: Error) => void; interactive?: boolean; } @@ -39,7 +39,7 @@ export const useMap = ({ interactive, bodyId, onError }: UseMapProps): MapLibreM try { setMap(createMap(interactive, bodyId, onError)); } catch (error) { - onError(error); + onError?.(error); } return () => { if (map) {