|
2 | 2 | import { AnyAction, createSlice, PayloadAction } from '@reduxjs/toolkit';
|
3 | 3 | import React, { useCallback, useEffect, useMemo, useReducer } from 'react';
|
4 | 4 | import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal';
|
5 |
| -import { useLocation, useRouteMatch, useParams } from 'react-router-dom'; |
| 5 | +import { useLocation, useRouteMatch } from 'react-router-dom'; |
6 | 6 |
|
7 | 7 | import { AppEvents, AppPlugin, AppPluginMeta, NavModel, NavModelItem, PluginType } from '@grafana/data';
|
8 |
| -import { config } from '@grafana/runtime'; |
| 8 | +import { config, locationSearchToObject } from '@grafana/runtime'; |
9 | 9 | import { getNotFoundNav, getWarningNav, getExceptionNav } from 'app/angular/services/nav_model_srv';
|
10 | 10 | import { Page } from 'app/core/components/Page/Page';
|
11 | 11 | import PageLoader from 'app/core/components/PageLoader/PageLoader';
|
@@ -35,13 +35,13 @@ const initialState: State = { loading: true, pluginNav: null, plugin: null };
|
35 | 35 |
|
36 | 36 | export function AppRootPage({ pluginId, pluginNavSection }: Props) {
|
37 | 37 | const match = useRouteMatch();
|
38 |
| - const queryParams = useParams(); |
39 | 38 | const location = useLocation();
|
40 | 39 | const [state, dispatch] = useReducer(stateSlice.reducer, initialState);
|
41 | 40 | const portalNode = useMemo(() => createHtmlPortalNode(), []);
|
42 | 41 | const currentUrl = config.appSubUrl + location.pathname + location.search;
|
43 | 42 | const { plugin, loading, pluginNav } = state;
|
44 | 43 | const navModel = buildPluginSectionNav(pluginNavSection, pluginNav, currentUrl);
|
| 44 | + const queryParams = useMemo(() => locationSearchToObject(location.search), [location.search]); |
45 | 45 | const context = useMemo(() => buildPluginPageContext(navModel), [navModel]);
|
46 | 46 |
|
47 | 47 | useEffect(() => {
|
|
0 commit comments