Skip to content

Commit

Permalink
fix(react-router): correctly set pathChanged in router events (#2649)
Browse files Browse the repository at this point in the history
  • Loading branch information
schiller-manuel authored Oct 27, 2024
1 parent eeb6dfd commit 627a0f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-router/src/Transitioner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function Transitioner() {
if (previousIsLoading && !routerState.isLoading) {
const toLocation = router.state.location
const fromLocation = router.state.resolvedLocation
const pathChanged = fromLocation.href !== toLocation.href
const pathChanged = fromLocation.pathname !== toLocation.pathname

router.emit({
type: 'onLoad', // When the new URL has committed, when the new matches have been loaded into state.matches
Expand Down Expand Up @@ -116,7 +116,7 @@ export function Transitioner() {
if (previousIsAnyPending && !isAnyPending) {
const toLocation = router.state.location
const fromLocation = router.state.resolvedLocation
const pathChanged = fromLocation.href !== toLocation.href
const pathChanged = fromLocation.pathname !== toLocation.pathname

router.emit({
type: 'onResolved',
Expand Down

0 comments on commit 627a0f8

Please sign in to comment.