In my custom pages/404.ts
file, I have coded the following:
export default function NotFound() {
return <h1>404 - Page Not Found</h1>
}
Additionally, there is another page that displays a 404 error when the organization is null:
import Error from 'next/error'
const Slug: NextPage<SlugProps> = ({ organization }) => {
if (!organization) {
return <Error statusCode={404} />
}
return <h1>{organization.name}</h1>
}
I want to configure NextJS to display my custom 404 page instead of the default one.
https://i.stack.imgur.com/9lzZe.png
How can I make sure that my 404 page is shown?