Skip to content

Commit

Permalink
fix: replace array at by reverse to ensure compatibility with old…
Browse files Browse the repository at this point in the history
…er browsers (#986)

fixes #925
  • Loading branch information
schiller-manuel authored Jan 14, 2024
1 parent c054f26 commit a4bfbf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ export class Router<
): ParsedLocation => {
const from = this.latestLocation
const fromSearch =
(this.state.pendingMatches || this.state.matches).at(-1)?.search ||
from.search
(this.state.pendingMatches || this.state.matches).reverse()[0]
?.search || from.search
let pathname = this.resolvePathWithBase(from.pathname, `${dest.to ?? ''}`)

const fromMatches = this.matchRoutes(from.pathname, fromSearch)
Expand Down

0 comments on commit a4bfbf1

Please sign in to comment.