When I use NextJS's not-found.tsx file, it renders fine but it returns a 200 status code instead of 404. Any idea why? How can I fix this?
I think since you are returning a valid custom component, it sets it as 200.
If you delete not-found.tsx
and use this
import { notFound } from 'next/navigation'
inside the component
if(true) notFound()
if you hover over notFound
When used in a React server component, this will set the status code to 404. When used in a custom app route it will just send a 404 status.