Skip to content

Commit c28fcc7

Browse files
committed
fix: avoid normalising paths with app routing hashes
Fixes #257
1 parent 05753be commit c28fcc7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/router/util.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ export function normaliseRoute(url: string): NormalisedRoute {
3333
}
3434

3535
const $url = new URL(url)
36+
const hash = $url.hash.startsWith('#/') ? $url.hash : ''
3637
// make sure we start with a leading slash
37-
const path = `${withLeadingSlash($url.pathname)}${$url.search}`
38+
const path = `${withLeadingSlash($url.pathname)}${hash}${$url.search}`
3839

3940
let normalised: Partial<NormalisedRoute> = {
40-
id: hashPathName(`${$url.pathname}${$url.search}`),
41+
id: hashPathName(path),
4142
url,
4243
$url,
4344
path,

0 commit comments

Comments
 (0)