mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
14 lines
425 B
TypeScript
14 lines
425 B
TypeScript
|
import { useLocation } from 'react-router-dom';
|
||
|
|
||
|
import { UrlQueryMap, urlUtil } from '@grafana/data';
|
||
|
import { locationSearchToObject } from '@grafana/runtime';
|
||
|
|
||
|
export function useAppQueryParams() {
|
||
|
const location = useLocation();
|
||
|
return locationSearchToObject(location.search || '');
|
||
|
}
|
||
|
|
||
|
export function getLinkUrlWithAppUrlState(path: string, params: UrlQueryMap): string {
|
||
|
return urlUtil.renderUrl(path, params);
|
||
|
}
|