From 903b123e00614924160025bbfe65f1c920cd0c8b Mon Sep 17 00:00:00 2001 From: ShaneK Date: Wed, 11 Mar 2026 11:07:35 -0700 Subject: [PATCH] fix(react-router): return '/' instead of '' for pathnameBase at root in relative path matching --- packages/react-router/src/ReactRouter/utils/pathMatching.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-router/src/ReactRouter/utils/pathMatching.ts b/packages/react-router/src/ReactRouter/utils/pathMatching.ts index 623564a407..7f764ad18d 100644 --- a/packages/react-router/src/ReactRouter/utils/pathMatching.ts +++ b/packages/react-router/src/ReactRouter/utils/pathMatching.ts @@ -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,