From cddb47664d31c7b60e1491ca4191e38bec5bfe05 Mon Sep 17 00:00:00 2001 From: Shashank Jarmale Date: Wed, 8 Apr 2026 15:09:48 -0700 Subject: [PATCH] Remove usage of `browserHistory` from `BarChartZoom` component --- static/app/components/charts/barChartZoom.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/app/components/charts/barChartZoom.tsx b/static/app/components/charts/barChartZoom.tsx index 170ec4e814e960..b644554a834deb 100644 --- a/static/app/components/charts/barChartZoom.tsx +++ b/static/app/components/charts/barChartZoom.tsx @@ -8,7 +8,7 @@ import type { EChartFinishedHandler, ECharts, } from 'sentry/types/echarts'; -import {browserHistory} from 'sentry/utils/browserHistory'; +import {useNavigate} from 'sentry/utils/useNavigate'; type RenderProps = { dataZoom: ReturnType; @@ -81,6 +81,8 @@ export function BarChartZoom({ paramStart, xAxisIndex, }: Props) { + const navigate = useNavigate(); + /** * Enable zoom immediately instead of having to toggle to zoom */ @@ -127,7 +129,7 @@ export function BarChartZoom({ if (onHistoryPush) { onHistoryPush(start, end); } else { - browserHistory.push(target); + navigate(target); } } else { // Dispatch the restore action here to stop ECharts from zooming