We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ecf9d0 commit 95be7a7Copy full SHA for 95be7a7
Website/contexts/SidebarContext.tsx
@@ -29,7 +29,9 @@ const sidebarReducer = (state: SidebarState, action: SidebarAction): SidebarStat
29
}
30
31
const SidebarContext = createContext<SidebarState>(initialState);
32
-const SidebarDispatcher = createContext<React.Dispatch<SidebarAction>>(() => { });
+const SidebarDispatcher = createContext<React.Dispatch<SidebarAction>>(() => {
33
+ throw new Error("SidebarDispatcher must be used within a SidebarProvider");
34
+});
35
export const SidebarProvider = ({ children }: { children: ReactNode }) => {
36
const [sidebarState, dispatch] = useReducer(sidebarReducer, initialState);
37
0 commit comments