Skip to content

Commit 2b27ca2

Browse files
authored
fix: onStay hook use current matches not previous
1 parent 975e32f commit 2b27ca2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/router-core/src/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,8 +2049,8 @@ export class RouterCore<
20492049
(match) =>
20502050
!previousMatches.some((d) => d.id === match.id),
20512051
)
2052-
stayingMatches = previousMatches.filter((match) =>
2053-
newMatches.some((d) => d.id === match.id),
2052+
stayingMatches = newMatches.filter((match) =>
2053+
previousMatches.some((d) => d.id === match.id),
20542054
)
20552055

20562056
return {

0 commit comments

Comments
 (0)