From f395292876cf2659ce780677759611573f902e7b Mon Sep 17 00:00:00 2001 From: Stephan Meijer Date: Mon, 13 Apr 2020 16:01:12 +0200 Subject: [PATCH] fix incorrect window check --- docs/hooks/useConfigureLeaflet.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/hooks/useConfigureLeaflet.ts b/docs/hooks/useConfigureLeaflet.ts index 961b909f..63c66a52 100644 --- a/docs/hooks/useConfigureLeaflet.ts +++ b/docs/hooks/useConfigureLeaflet.ts @@ -7,11 +7,13 @@ const viewport: Viewport = { }; export interface LeafletConfig { - viewport: Viewport; + viewport?: Viewport; } const useConfigureLeaflet = (): LeafletConfig => { - if (!window) return; + if (typeof window === 'undefined') { + return {}; + } // To get around an issue with the default icon not being set up right between using React // and importing the leaflet library, we need to reset the image imports