MCPcopy
hub / github.com/azouaoui-med/react-pro-sidebar / useMenu

Function useMenu

src/hooks/useMenu.tsx:4–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { MenuContext, MenuContextProps } from '../components/Menu';
3
4export const useMenu = (): MenuContextProps => {
5 const context = React.useContext(MenuContext);
6 if (context === undefined) {
7 //TODO: set better error message
8 throw new Error('Menu Component is required!');
9 }
10 return context;
11};

Callers 3

SubMenuContentFRFunction · 0.90
SubMenuFRFunction · 0.90
MenuItemFRFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected