fix(react-router): return '/' instead of '' for pathnameBase at root in relative path matching

This commit is contained in:
ShaneK
2026-03-11 11:07:35 -07:00
parent 62bd43f76b
commit 903b123e00

View File

@@ -80,7 +80,7 @@ export const matchPath = ({ pathname, componentProps }: MatchPathOptions): PathM
return {
...match,
pathname: pathname,
pathnameBase: match.pathnameBase === '/' ? '' : match.pathnameBase.slice(1),
pathnameBase: match.pathnameBase === '/' ? '/' : match.pathnameBase.slice(1),
pattern: {
...match.pattern,
path: path,