Skip to content

Commit 8232409

Browse files
authored
Merge branch 'dai-shi:main' into refactor-fs-router
2 parents 4500c06 + bf4fe71 commit 8232409

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/waku/src/router/create-pages.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ export const new_createPages = <
768768
}
769769
return paths;
770770
},
771-
renderRoute: async (path) => {
771+
renderRoute: async (path, { query }) => {
772772
await configure();
773773

774774
// path without slugs
@@ -783,7 +783,6 @@ export const new_createPages = <
783783

784784
const pathSpec = parsePathWithSlug(routePath);
785785
const mapping = getPathMapping(pathSpec, path);
786-
787786
const result: Record<string, ReactNode> = {
788787
root: createElement(
789788
rootItem ? rootItem.component : DefaultRoot,
@@ -792,7 +791,7 @@ export const new_createPages = <
792791
),
793792
[`page:${routePath}`]: createElement(
794793
pageComponent,
795-
mapping,
794+
{ ...mapping, ...(query ? { query } : {}) },
796795
createElement(Children),
797796
),
798797
};

packages/waku/src/router/define-router.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ globalThis.__WAKU_ROUTER_PREFETCH__ = (path) => {
484484
});
485485
return {
486486
rscPath,
487-
rscParams: JSON.stringify({ query: searchParams.toString() }),
487+
rscParams: new URLSearchParams({ query: searchParams.toString() }),
488488
html,
489489
};
490490
};

0 commit comments

Comments
 (0)