mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
bf45e97641
* Update types * fix circular dep * type imports * lint type imports and --fix
13 lines
392 B
TypeScript
13 lines
392 B
TypeScript
import { useLocation } from "react-router-dom";
|
|
import type { 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;
|
|
}
|