Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Commit 482f09f

Browse files
committed
Fix query params precedence
As mentioned in #5, inline parameters now take precedence over query parameters with the same name as intended.
1 parent f343be0 commit 482f09f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Router {
5555
if (acc.page) return acc
5656
const { pathname, query: queryParams } = urlLib.parse(url, true)
5757
const params = match(pattern)(pathname)
58-
if (params) return { page, params: { ...params, ...queryParams } }
58+
if (params) return { page, params: { ...queryParams, ...params } }
5959
else return acc
6060
}, {})
6161
}

0 commit comments

Comments
 (0)