Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroborges committed Sep 21, 2024
1 parent 78cb9dc commit 3d87fac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ export class Router {

protected pushState(page: Page): void {
this.page = page
// Defer history.pushState to the next event loop tick to prevent timing conflicts.
// Ensure any previous history.replaceState completes before pushState is executed.
setTimeout(() => window.history.pushState(cloneSerializable(page), '', page.url))
}

Expand Down

0 comments on commit 3d87fac

Please sign in to comment.