@@ -13,9 +13,9 @@ import {decodeScalar} from 'sentry/utils/queryString';
1313import { MutableSearch } from 'sentry/utils/tokenizeSearch' ;
1414import { useLocationQuery } from 'sentry/utils/url/useLocationQuery' ;
1515import { useLocation } from 'sentry/utils/useLocation' ;
16+ import { useNavigate } from 'sentry/utils/useNavigate' ;
1617import { useOrganization } from 'sentry/utils/useOrganization' ;
1718import { useProjects } from 'sentry/utils/useProjects' ;
18- import { useRouter } from 'sentry/utils/useRouter' ;
1919import { TraceItemSearchQueryBuilder } from 'sentry/views/explore/components/traceItemSearchQueryBuilder' ;
2020import { DATA_TYPE } from 'sentry/views/insights/browser/resources/settings' ;
2121import { decodeSubregions } from 'sentry/views/insights/browser/resources/utils/queryParameterDecoders/subregions' ;
@@ -82,7 +82,7 @@ export function SampleList({groupId, moduleName, transactionRoute, referrer}: Pr
8282 } ,
8383 } ) ;
8484
85- const router = useRouter ( ) ;
85+ const navigate = useNavigate ( ) ;
8686 const [ highlightedSpanId , setHighlightedSpanId ] = useState < string | undefined > (
8787 undefined
8888 ) ;
@@ -101,13 +101,16 @@ export function SampleList({groupId, moduleName, transactionRoute, referrer}: Pr
101101 ) ;
102102
103103 const handleSearch = ( newSpanSearchQuery : string ) => {
104- router . replace ( {
105- pathname : location . pathname ,
106- query : {
107- ...location . query ,
108- spanSearchQuery : newSpanSearchQuery ,
104+ navigate (
105+ {
106+ pathname : location . pathname ,
107+ query : {
108+ ...location . query ,
109+ spanSearchQuery : newSpanSearchQuery ,
110+ } ,
109111 } ,
110- } ) ;
112+ { replace : true }
113+ ) ;
111114 } ;
112115
113116 // set additional query filters from the span search bar and the `query` param
@@ -146,7 +149,7 @@ export function SampleList({groupId, moduleName, transactionRoute, referrer}: Pr
146149
147150 const handleClickSample = useCallback (
148151 ( span : SpanSample ) => {
149- router . push (
152+ navigate (
150153 generateLinkToEventInTraceView ( {
151154 targetId : span [ 'transaction.span_id' ] ,
152155 spanId : span . span_id ,
@@ -157,7 +160,7 @@ export function SampleList({groupId, moduleName, transactionRoute, referrer}: Pr
157160 } )
158161 ) ;
159162 } ,
160- [ organization , location , router ]
163+ [ organization , location , navigate ]
161164 ) ;
162165
163166 const handleMouseOverSample = useCallback (
0 commit comments