Skip to content

Commit 903b123

Browse files
committed
fix(react-router): return '/' instead of '' for pathnameBase at root in relative path matching
1 parent 62bd43f commit 903b123

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-router/src/ReactRouter/utils/pathMatching.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const matchPath = ({ pathname, componentProps }: MatchPathOptions): PathM
8080
return {
8181
...match,
8282
pathname: pathname,
83-
pathnameBase: match.pathnameBase === '/' ? '' : match.pathnameBase.slice(1),
83+
pathnameBase: match.pathnameBase === '/' ? '/' : match.pathnameBase.slice(1),
8484
pattern: {
8585
...match.pattern,
8686
path: path,

0 commit comments

Comments
 (0)