Skip to content

Commit 7842a65

Browse files
fix: do not append empty basename to path
1 parent c4cc1b0 commit 7842a65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function createHref(
8686

8787
const compiledRoute = `${compile(preparedRoute)(params)}${search}`;
8888

89-
if (options.withBasename) {
89+
if (options.withBasename && basename) {
9090
// For SPA links react-router adds basename itself
9191
// It is needed for external links - <a> or uikit <Link>
9292
return normalizePathSlashes(`${basename}/${compiledRoute}`);

0 commit comments

Comments
 (0)