mt-flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
10 lines (9 loc) • 338 B
JavaScript
import { createContext, useContext } from 'react';
export const SidebarContext = createContext(undefined);
export function useSidebarContext() {
const context = useContext(SidebarContext);
if (!context) {
throw new Error('useSidebarContext should be used within the SidebarContext provider!');
}
return context;
}