diff --git a/packages/runtime/CHANGELOG.md b/packages/runtime/CHANGELOG.md index e8770383ea..5243f5a572 100644 --- a/packages/runtime/CHANGELOG.md +++ b/packages/runtime/CHANGELOG.md @@ -1,5 +1,9 @@ # @ice/runtime +## 1.4.1 + +- fix: compatible with basename is undefined. + ## 1.4.0 ### Minor Changes diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 69940a6576..9252da021f 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@ice/runtime", - "version": "1.4.0", + "version": "1.4.1", "description": "Runtime module for ice.js", "type": "module", "types": "./esm/index.d.ts", diff --git a/packages/runtime/src/singleRouter.tsx b/packages/runtime/src/singleRouter.tsx index d51346c4d7..312d82e01d 100644 --- a/packages/runtime/src/singleRouter.tsx +++ b/packages/runtime/src/singleRouter.tsx @@ -24,7 +24,6 @@ RouteContext.displayName = 'RouteContext'; export function useData(): T { const value = React.useContext(RouteContext); - console.log('use value', value); return value.routeData?.data; } @@ -259,7 +258,7 @@ export const matchRoutes = ( basename: string, ) => { const pathname = typeof location === 'string' ? location : location.pathname; - const stripedPathname = stripBasename(pathname || '/', basename); + const stripedPathname = stripBasename(pathname || '/', basename || '/'); let branches = flattenRoutes(routes); if (branches.length === 1) { // Just one branch, no need to match.