From 6f404d7ad00f05943af82d3187acdc90997d7cea Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Mon, 17 Apr 2023 15:32:04 -0700 Subject: [PATCH] fix history issue (#371) Signed-off-by: Eric Wei --- public/components/event_analytics/explorer/log_explorer.tsx | 3 ++- public/components/event_analytics/index.tsx | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/components/event_analytics/explorer/log_explorer.tsx b/public/components/event_analytics/explorer/log_explorer.tsx index 6953e6c8b..4fced3eea 100644 --- a/public/components/event_analytics/explorer/log_explorer.tsx +++ b/public/components/event_analytics/explorer/log_explorer.tsx @@ -15,6 +15,7 @@ import $ from 'jquery'; import { isEmpty, map } from 'lodash'; import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; +import { useHistory } from 'react-router-dom'; import { LogExplorerRouterContext } from '..'; import { APP_ANALYTICS_TAB_ID_REGEX, @@ -53,11 +54,11 @@ export const LogExplorer = ({ setToast, savedObjectId, getExistingEmptyTab, - history, notifications, http, queryManager, }: ILogExplorerProps) => { + const history = useHistory(); const routerContext = useContext(LogExplorerRouterContext); const dispatch = useDispatch(); const tabIds = useSelector(selectQueryTabs).queryTabIds.filter( diff --git a/public/components/event_analytics/index.tsx b/public/components/event_analytics/index.tsx index a22e6966b..69c469af1 100644 --- a/public/components/event_analytics/index.tsx +++ b/public/components/event_analytics/index.tsx @@ -32,7 +32,6 @@ export const EventAnalytics = ({ setBreadcrumbs, ...props }: EventAnalyticsProps) => { - const history = useHistory(); const [toasts, setToasts] = useState([]); const eventAnalyticsBreadcrumb = { @@ -95,7 +94,6 @@ export const EventAnalytics = ({ http={http} setToast={setToast} getExistingEmptyTab={getExistingEmptyTab} - history={history} notifications={notifications} queryManager={queryManager} />