diff --git a/static/app/views/profiling/profileSummary/regressedProfileFunctions.tsx b/static/app/views/profiling/profileSummary/regressedProfileFunctions.tsx index 805c47ec93ef44..bdbfa997eaea80 100644 --- a/static/app/views/profiling/profileSummary/regressedProfileFunctions.tsx +++ b/static/app/views/profiling/profileSummary/regressedProfileFunctions.tsx @@ -15,7 +15,6 @@ import type {Organization} from 'sentry/types/organization'; import type {Project} from 'sentry/types/project'; import {defined} from 'sentry/utils'; import {trackAnalytics} from 'sentry/utils/analytics'; -import {browserHistory} from 'sentry/utils/browserHistory'; import {formatPercentage} from 'sentry/utils/number/formatPercentage'; import type {FunctionTrend, TrendType} from 'sentry/utils/profiling/hooks/types'; import {useCurrentProjectFromRouteParam} from 'sentry/utils/profiling/hooks/useCurrentProjectFromRouteParam'; @@ -28,6 +27,7 @@ import {relativeChange} from 'sentry/utils/profiling/units/units'; import {decodeScalar} from 'sentry/utils/queryString'; import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; +import {useNavigate} from 'sentry/utils/useNavigate'; import useOrganization from 'sentry/utils/useOrganization'; import {ProfilingSparklineChart} from './profilingSparklineChart'; @@ -124,6 +124,7 @@ interface MostRegressedProfileFunctionsProps { export function MostRegressedProfileFunctions(props: MostRegressedProfileFunctionsProps) { const organization = useOrganization(); const project = useCurrentProjectFromRouteParam(); + const navigate = useNavigate(); const location = useLocation(); const theme = useTheme(); @@ -132,12 +133,15 @@ export function MostRegressedProfileFunctions(props: MostRegressedProfileFunctio [location.query] ); - const handleRegressedFunctionsCursor = useCallback((cursor, pathname, query) => { - browserHistory.push({ - pathname, - query: {...query, [REGRESSED_FUNCTIONS_CURSOR]: cursor}, - }); - }, []); + const handleRegressedFunctionsCursor = useCallback( + (cursor, pathname, query) => { + navigate({ + pathname, + query: {...query, [REGRESSED_FUNCTIONS_CURSOR]: cursor}, + }); + }, + [navigate] + ); const functionQuery = useMemo(() => { const conditions = new MutableSearch('');