diff --git a/packages/react-router/src/ReactRouter/StackManager.tsx b/packages/react-router/src/ReactRouter/StackManager.tsx index 1acfd48468..603735946d 100644 --- a/packages/react-router/src/ReactRouter/StackManager.tsx +++ b/packages/react-router/src/ReactRouter/StackManager.tsx @@ -438,7 +438,7 @@ function matchRoute(node: React.ReactNode, routeInfo: RouteInfo) { path: child.props.path || child.props.from, component: child.props.component, }; - const match = matchPath(routeInfo.pathname, matchProps); + const match = matchPath(matchProps, routeInfo.pathname); if (match) { matchedNode = child; } @@ -464,7 +464,7 @@ function matchComponent(node: React.ReactElement, pathname: string, forceExact?: path: node.props.path || node.props.from, component: node.props.component, }; - const match = matchPath(pathname, matchProps); + const match = matchPath(matchProps, pathname); return match; }