【发布时间】:2022-08-09 07:54:23
【问题描述】:
-
嘿,鲍比,@corygibbons 的回答解决了你的问题吗?如果是这样,请考虑将其标记为已解决。还想在我的仓库github.com/CanRau/canrau.com/blob/main/app/routes/%24lang/… 中分享一个示例,如果您还有其他问题,请告诉我
标签: remix
标签: remix
您可以编辑root.tsx/root.tsx 中的CatchBoundary 并返回您想要渲染的任何内容。
export function CatchBoundary() {
const caught = useCatch();
return (
<html>
<head>
<title>Oops!</title>
<Meta />
<Links />
</head>
<body>
<h1>
{caught.status} {caught.statusText}
</h1>
<Scripts />
</body>
</html>
);
}
相关文档:https://remix.run/docs/en/v1/guides/not-found#root-catch-boundary
【讨论】:
创建一个routes/$.jsx 文件。
【讨论】: