Skh*_*haz 3 javascript typescript next.js
我有一个pages/404.ts包含以下内容的自定义:
export default function NotFound() {
return <h1>404 - Page Not Found</h1>
}
Run Code Online (Sandbox Code Playgroud)
我还有另一个页面,当某个组织为空时显示 404:
import Error from 'next/error'
const Slug: NextPage<SlugProps> = ({ organization }) => {
if (!organization) {
return <Error statusCode={404} />
}
return <h1>{organization.name}</h1>
}
Run Code Online (Sandbox Code Playgroud)
我想要 NextJS 显示我的自定义 404 页面,而不是显示默认页面
我需要做什么才能显示我的404 页面?
| 归档时间: |
|
| 查看次数: |
3105 次 |
| 最近记录: |