fix basePath prefix

This commit is contained in:
Alaister Young committed 2026-05-08 17:16:37 +08:00
1 parent f1cee47485
commit 41f75eb993
1 file changed
+5 -1
+5 -1
View File
@@ -104,7 +104,11 @@ export function useRouter() {
route: pathPattern,
query: { ...params, ...search },
asPath: location.href,
basePath: router.basepath ?? '',
basePath: router.basepath
? router.basepath.startsWith('/')
? router.basepath
: `/${router.basepath}`
: '',
// TanStack resolves params/search synchronously on render, so the
// pages-router "is the dynamic param ready yet?" flag is always
// true here. (In Next this can be false during the very first