Skip to content

Commit

Permalink
fix: fix renderPage
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 10, 2024
1 parent 9c2b27a commit b54273b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,30 @@ exports[`generateRouteModuleTree > basic 2`] = `
</React.Fragment>,
},
"pages": {
"/x": Promise {},
"/x": </X/PAGE.TSX
params={{}}
request={
{
"headers": {},
"url": "https://test.local/x",
}
}
url={
{
"hash": "",
"host": "test.local",
"hostname": "test.local",
"href": "https://test.local/x",
"origin": "https://test.local",
"password": "",
"pathname": "/x",
"port": "",
"protocol": "https:",
"search": "",
"username": "",
}
}
/>,
},
}
`;
Expand Down Expand Up @@ -158,7 +181,30 @@ exports[`generateRouteModuleTree > basic 3`] = `
<//X/Y/LAYOUT.TSX>,
},
"pages": {
"/x/y": Promise {},
"/x/y": </X/Y/PAGE.TSX
params={{}}
request={
{
"headers": {},
"url": "https://test.local/x/y",
}
}
url={
{
"hash": "",
"host": "test.local",
"hostname": "test.local",
"href": "https://test.local/x/y",
"origin": "https://test.local",
"password": "",
"pathname": "/x/y",
"port": "",
"protocol": "https:",
"search": "",
"username": "",
}
}
/>,
},
}
`;
Expand Down Expand Up @@ -206,7 +252,30 @@ exports[`generateRouteModuleTree > basic 4`] = `
</React.Fragment>,
},
"pages": {
"/z": Promise {},
"/z": <ThrowNotFound
params={{}}
request={
{
"headers": {},
"url": "https://test.local/z",
}
}
url={
{
"hash": "",
"host": "test.local",
"hostname": "test.local",
"href": "https://test.local/z",
"origin": "https://test.local",
"password": "",
"pathname": "/z",
"port": "",
"protocol": "https:",
"search": "",
"username": "",
}
}
/>,
},
}
`;
2 changes: 1 addition & 1 deletion packages/react-server/src/features/router/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export async function renderRouteMap(
if (m.type === "layout") {
layouts[m.prefix] = await renderLayout(m.node, props, m.prefix);
} else if (m.type === "page") {
pages[m.prefix] = renderPage(m.node, props);
pages[m.prefix] = await renderPage(m.node, props);
} else {
m.type satisfies never;
}
Expand Down

0 comments on commit b54273b

Please sign in to comment.