We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d14c3f commit 055b614Copy full SHA for 055b614
packages/react/src/reactrouterv6-compat-utils.tsx
@@ -426,8 +426,8 @@ function getNormalizedName(
426
427
// If path is not a wildcard and has no child routes, append the path
428
if (path && !pathIsWildcardAndHasChildren(path, branch)) {
429
- const newPath = prefixWithSlash(path);
430
- pathBuilder = trimSlash(pathBuilder) + newPath;
+ const newPath = path[0] === '/' || pathBuilder[pathBuilder.length - 1] === '/' ? path : `/${path}`;
+ pathBuilder = trimSlash(pathBuilder) + prefixWithSlash(newPath);
431
432
// If the path matches the current location, return the path
433
if (trimSlash(location.pathname) === trimSlash(basename + branch.pathname)) {
0 commit comments