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

Commit 41da14c

Browse files
committed
feat(super params): added super route params capability
1 parent c92f1ae commit 41da14c

File tree

2 files changed

+51
-20
lines changed

2 files changed

+51
-20
lines changed

package-lock.json

+45-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Router.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ class Router {
6363
getRequestHandler = (app) => {
6464
const handle = app.getRequestHandler()
6565

66-
return (req, res) => {
66+
return (req, res, superParams) => {
6767
const { page, params } = this.getMatchingRoute(req.url)
68-
if (page) app.render(req, res, page, params)
69-
else handle(req, res)
68+
if (page) app.render(req, res, page, {
69+
...params,
70+
...superParams
71+
})
72+
else handle(req, res, null, superParams)
7073
}
7174
}
7275

0 commit comments

Comments
 (0)