Question · Next.js course · Module 2: Routing and Layouts

The not-found.tsx Component in Next.js

What happens when you call the notFound() function inside a Server Component in Next.js 16?

Answer options

  • Next.js will render the nearest not-found.tsx file in the route hierarchy
  • The component will return an empty JSX fragment
  • The browser will automatically redirect to the home page
  • The application will throw an unhandled error and crash
Show the answer

Correct answer:

  • Next.js will render the nearest not-found.tsx file in the route hierarchy