Skip to content

Commit 32a411a

Browse files
committed
ref(profiling): replace useRouter with specific hooks in slowestFunctionsWidget
1 parent 876b9a5 commit 32a411a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

static/app/views/profiling/landing/slowestFunctionsWidget.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import {useLocation} from 'sentry/utils/useLocation';
4747
import {useNavigate} from 'sentry/utils/useNavigate';
4848
import {useOrganization} from 'sentry/utils/useOrganization';
4949
import {useProjects} from 'sentry/utils/useProjects';
50-
import {useRouter} from 'sentry/utils/useRouter';
5150
import type {DataState} from 'sentry/views/profiling/useLandingAnalytics';
5251
import {getProfileTargetId} from 'sentry/views/profiling/utils';
5352

@@ -88,7 +87,6 @@ export function SlowestFunctionsWidget<F extends BreakdownFunction>({
8887
onDataState,
8988
}: SlowestFunctionsWidgetProps<F>) {
9089
const navigate = useNavigate();
91-
const router = useRouter();
9290
const location = useLocation();
9391
const organization = useOrganization();
9492

@@ -219,11 +217,14 @@ export function SlowestFunctionsWidget<F extends BreakdownFunction>({
219217
onChange={option => {
220218
setSortFunction(option.value as SortOption);
221219
setExpandedIndex(0);
222-
const newQuery = omit(router.location.query, [cursorName]);
223-
router.replace({
224-
pathname: router.location.pathname,
225-
query: newQuery,
226-
});
220+
const newQuery = omit(location.query, [cursorName]);
221+
navigate(
222+
{
223+
pathname: location.pathname,
224+
query: newQuery,
225+
},
226+
{replace: true}
227+
);
227228
}}
228229
trigger={triggerProps => (
229230
<OverlayTrigger.Button

0 commit comments

Comments
 (0)