Skip to content

Commit

Permalink
fix(core): fix doubling hash in react StrictMode (based on [inertia…
Browse files Browse the repository at this point in the history
…/pull/1728](inertiajs/inertia#1728))
  • Loading branch information
jrson83 committed Apr 26, 2024
1 parent b20e967 commit ebcba61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ export class Router {
}

protected handleInitialPageVisit(page: Page): void {
this.page.url += window.location.hash
const hash = window.location.hash
if (!this.page.url.includes(hash)) {
this.page.url += window.location.hash
}
this.setPage(page, { preserveState: true }).then(() =>
fireNavigateEvent(page)
)
Expand Down

0 comments on commit ebcba61

Please sign in to comment.