There was an error while loading. Please reload this page.
1 parent 2bf3314 commit 46bcb8eCopy full SHA for 46bcb8e
1 file changed
packages/history/index.ts
@@ -595,8 +595,13 @@ export function createHashHistory(
595
return parsePath(pathname.replace(hashRoot, '/'));
596
}
597
598
- function parsePathOutput(pathname) {
599
- return parsePath(pathname.replace('/', hashRoot));
+ function parsePathOutput(to) {
+ let path = typeof to === 'string' ? parsePath(to) : to
600
+ let pathname = parsePath(pathname.replace('/', hashRoot));
601
+ return {
602
+ ...path,
603
+ pathname
604
+ }
605
606
607
function getIndexAndLocation(): [number, Location] {
@@ -708,7 +713,7 @@ export function createHashHistory(
708
713
pathname: location.pathname,
709
714
hash: '',
710
715
search: '',
711
- ...(typeof to === 'string' ? parsePathOutput(to) : to),
716
+ ...parsePathOutput(to),
712
717
state,
718
key: createKey()
719
});
0 commit comments