diff --git a/src/context/DisplayModeContext.ts b/src/context/DisplayModeContext.ts index 6a59de7..a7f77dc 100644 --- a/src/context/DisplayModeContext.ts +++ b/src/context/DisplayModeContext.ts @@ -1,10 +1,15 @@ import React from "react"; import { ViewMode } from "../routes/ViewMode"; -export const DisplayModeContext = React.createContext<{ - mode: ViewMode; - setMode: (mode: ViewMode) => void; -}>({ +const defaultValue: DisplayModeContextType = { mode: "map", setMode: () => {}, -}); +}; + +interface DisplayModeContextType { + mode: ViewMode; + setMode: (mode: ViewMode) => void; +} + +export const DisplayModeContext = + React.createContext(defaultValue);