mirror of
https://github.com/outline/outline.git
synced 2026-11-22 22:02:35 +03:00
13 lines
359 B
TypeScript
13 lines
359 B
TypeScript
import { useLocation } from "react-router-dom";
|
|
import { SidebarContextType } from "../components/SidebarContext";
|
|
|
|
/**
|
|
* Hook to retrieve the sidebar context from the current location state.
|
|
*/
|
|
export function useLocationState() {
|
|
const location = useLocation<{
|
|
sidebarContext?: SidebarContextType;
|
|
}>();
|
|
return location.state?.sidebarContext;
|
|
}
|