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

Commit 4388602

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

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Router.js

Lines changed: 6 additions & 3 deletions
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)