@@ -66,14 +66,14 @@ import {
6666 routerViewLocationKey ,
6767} from './injectionSymbols'
6868import { addDevtools } from './devtools'
69- import { _LiteralUnion } from './types/utils'
7069import { RouteLocationAsRelativeTyped } from './typed-routes/route-location'
7170import { RouteMap } from './typed-routes/route-map'
7271import {
7372 RouterViewTransition ,
7473 TransitionMode ,
7574 transitionModeKey ,
7675} from './transition'
76+ import { isChangingPage } from './utils/routes'
7777
7878/**
7979 * Internal type to define an ErrorHandler
@@ -1251,7 +1251,7 @@ export function createRouter(
12511251 let beforeResolveTransitionGuard : ( ( ) => void ) | undefined
12521252 let afterEachTransitionGuard : ( ( ) => void ) | undefined
12531253 let onErrorTransitionGuard : ( ( ) => void ) | undefined
1254- let popStateListener : ( ( ) => void ) | undefined
1254+ let popStateListener : ( ( event : PopStateEvent ) => void ) | undefined
12551255
12561256 const router : Router = {
12571257 currentRoute,
@@ -1401,27 +1401,6 @@ function extractChangingRecords(
14011401 return [ leavingRecords , updatingRecords , enteringRecords ]
14021402}
14031403
1404- function isChangingPage (
1405- to : RouteLocationNormalized ,
1406- from : RouteLocationNormalized
1407- ) {
1408- if ( to === from || from === START_LOCATION ) {
1409- return false
1410- }
1411-
1412- // If route keys are different then it will result in a rerender
1413- if ( generateRouteKey ( to ) !== generateRouteKey ( from ) ) {
1414- return true
1415- }
1416-
1417- const areComponentsSame = to . matched . every (
1418- ( comp , index ) =>
1419- comp . components &&
1420- comp . components . default === from . matched [ index ] ?. components ?. default
1421- )
1422- return ! areComponentsSame
1423- }
1424-
14251404function enableViewTransition ( router : Router , options : RouterViewTransition ) {
14261405 let transition : undefined | ViewTransition
14271406 let hasUAVisualTransition = false
0 commit comments