Skip to content

Commit 91ea6c8

Browse files
committed
fix path="/" returning match.url === '' at deeper pathnames
1 parent 8c0d9b9 commit 91ea6c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-router/modules/matchPath.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const matchPath = (pathname, path, options={}) => {
4646

4747
return {
4848
path, // the path pattern used to match
49-
url, // the matched portion of the URL
49+
url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL
5050
isExact, // whether or not we matched exactly
5151
params: keys.reduce((memo, key, index) => {
5252
memo[key.name] = values[index]

0 commit comments

Comments
 (0)