mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-03 05:23:26 +00:00
12 lines
288 B
TypeScript
12 lines
288 B
TypeScript
import React from 'react';
|
|
import { SidebarContext } from './sidebar';
|
|
|
|
export const useSidebar = () => {
|
|
const context = React.useContext(SidebarContext);
|
|
if (!context) {
|
|
throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
}
|
|
|
|
return context;
|
|
};
|