mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
13 lines
332 B
TypeScript
13 lines
332 B
TypeScript
import type {Location, Query} from 'history';
|
|
|
|
import {useRouteContext} from 'sentry/utils/useRouteContext';
|
|
|
|
type DefaultQuery<T = string> = {
|
|
[key: string]: T | T[] | null | undefined;
|
|
};
|
|
|
|
export function useLocation<Q extends Query = DefaultQuery>(): Location<Q> {
|
|
const route = useRouteContext();
|
|
return route.location;
|
|
}
|