Skip to content

Commit cddb476

Browse files
committed
Remove usage of browserHistory from BarChartZoom component
1 parent 8b28ee1 commit cddb476

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

static/app/components/charts/barChartZoom.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
EChartFinishedHandler,
99
ECharts,
1010
} from 'sentry/types/echarts';
11-
import {browserHistory} from 'sentry/utils/browserHistory';
11+
import {useNavigate} from 'sentry/utils/useNavigate';
1212

1313
type RenderProps = {
1414
dataZoom: ReturnType<typeof DataZoomInside>;
@@ -81,6 +81,8 @@ export function BarChartZoom({
8181
paramStart,
8282
xAxisIndex,
8383
}: Props) {
84+
const navigate = useNavigate();
85+
8486
/**
8587
* Enable zoom immediately instead of having to toggle to zoom
8688
*/
@@ -127,7 +129,7 @@ export function BarChartZoom({
127129
if (onHistoryPush) {
128130
onHistoryPush(start, end);
129131
} else {
130-
browserHistory.push(target);
132+
navigate(target);
131133
}
132134
} else {
133135
// Dispatch the restore action here to stop ECharts from zooming

0 commit comments

Comments
 (0)