Skip to content

Commit 95be7a7

Browse files
Lucki2gCopilot
andauthored
Update Website/contexts/SidebarContext.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6ecf9d0 commit 95be7a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Website/contexts/SidebarContext.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const sidebarReducer = (state: SidebarState, action: SidebarAction): SidebarStat
2929
}
3030

3131
const SidebarContext = createContext<SidebarState>(initialState);
32-
const SidebarDispatcher = createContext<React.Dispatch<SidebarAction>>(() => { });
32+
const SidebarDispatcher = createContext<React.Dispatch<SidebarAction>>(() => {
33+
throw new Error("SidebarDispatcher must be used within a SidebarProvider");
34+
});
3335
export const SidebarProvider = ({ children }: { children: ReactNode }) => {
3436
const [sidebarState, dispatch] = useReducer(sidebarReducer, initialState);
3537

0 commit comments

Comments
 (0)