In Nextjs
you can declare 404 error like this:
return {notFound: true};
My question is how can I send additional data for my custom 404 page
to show customized error text to users? Something like this:
return {notFound: true, props: {err:"Product was not found!"}}
And if I log props
in my custom 404 page
I get this:
export default function NotFound(props) {
console.log(props) // output is: {err: undefined}
return <Error statusCode={404} title="custom title" />
}