Skip to content

Commit b043955

Browse files
committed
Give some guidance for 404 with catch-all routes
1 parent 5f745c0 commit b043955

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/guides/advanced/ServerRendering.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ serve((req, res) => {
2727
} else if (redirectLocation) {
2828
res.redirect(302, redirectLocation.pathname + redirectLocation.search)
2929
} else if (renderProps) {
30+
// You can also check renderProps.components or renderProps.routes for
31+
// your "not found" component or route respectively, and send a 404 as
32+
// below, if you're using a catch-all route.
3033
res.status(200).send(renderToString(<RouterContext {...renderProps} />))
3134
} else {
3235
res.status(404).send('Not found')

0 commit comments

Comments
 (0)