From 2407080cc294825aa0fd5a95d805e1b1b22d3629 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Fri, 6 Aug 2021 13:04:00 +0200 Subject: [PATCH] [APM] Invalidate trackPageview on route change (#107741) Closes #107728. --- .../plugins/apm/public/components/routing/track_pageview.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/apm/public/components/routing/track_pageview.tsx b/x-pack/plugins/apm/public/components/routing/track_pageview.tsx index 20e02a505bc43..7f4a03cae90be 100644 --- a/x-pack/plugins/apm/public/components/routing/track_pageview.tsx +++ b/x-pack/plugins/apm/public/components/routing/track_pageview.tsx @@ -11,8 +11,8 @@ import { useTrackPageview } from '../../../../observability/public'; export function TrackPageview({ children }: { children: React.ReactElement }) { const routePath = useRoutePath(); - useTrackPageview({ app: 'apm', path: routePath }); - useTrackPageview({ app: 'apm', path: routePath, delay: 15000 }); + useTrackPageview({ app: 'apm', path: routePath }, [routePath]); + useTrackPageview({ app: 'apm', path: routePath, delay: 15000 }, [routePath]); return children; }