Skip to content

Commit

Permalink
fix(react-router): search getting overridden on page load (#2346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravilamichhane authored Sep 18, 2024
1 parent b5080c6 commit b0be38e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ export class Router<
'Could not find match for from: ' + dest.from,
)

const fromSearch = this.state.pendingMatches
const fromSearch = this.state.pendingMatches?.length
? last(this.state.pendingMatches)?.search
: last(fromMatches)?.search || this.latestLocation.search

Expand Down

0 comments on commit b0be38e

Please sign in to comment.