mirror of
https://github.com/outline/outline.git
synced 2026-01-05 10:40:07 -06:00
13 lines
387 B
TypeScript
13 lines
387 B
TypeScript
import { useLocation } from "react-router-dom";
|
|
import { SidebarContextType } from "../components/Sidebar/components/SidebarContext";
|
|
|
|
/**
|
|
* Hook to retrieve the sidebar context from the current location state.
|
|
*/
|
|
export function useLocationSidebarContext() {
|
|
const location = useLocation<{
|
|
sidebarContext?: SidebarContextType;
|
|
}>();
|
|
return location.state?.sidebarContext;
|
|
}
|