Recall & Review
beginner
What is the purpose of the
not-found.tsx file in a Next.js app?The
not-found.tsx file defines a custom 404 page that shows when a user visits a URL that does not match any route in the app.Click to reveal answer
intermediate
How do you trigger the
not-found.tsx page programmatically in Next.js?You can call the
notFound() function from next/navigation inside a server component or route handler to show the custom 404 page.Click to reveal answer
beginner
Which React component type should you use for
not-found.tsx in Next.js 13+?Use a functional React component as a Server Component by default. It can be async if you need to fetch data.
Click to reveal answer
beginner
Can you add custom styles and layout to
not-found.tsx?Yes, you can add any React elements, CSS modules, or Tailwind CSS classes to style the 404 page to match your app's design.
Click to reveal answer
intermediate
What is a good accessibility practice when customizing the
not-found.tsx page?Use semantic HTML like
<main> and <h1> for the main message, and provide clear text so screen readers understand the page is a 404 error.Click to reveal answer
What does the
notFound() function do in Next.js?✗ Incorrect
Calling
notFound() triggers the display of the custom 404 page defined in not-found.tsx.Where should you place the
not-found.tsx file in a Next.js app?✗ Incorrect
In Next.js 13+, the
not-found.tsx file belongs inside the app directory to customize the 404 page.Which component type is recommended for
not-found.tsx in Next.js 13+?✗ Incorrect
Next.js 13+ uses functional Server Components by default for files like
not-found.tsx.What is a good way to make the 404 page accessible?
✗ Incorrect
Semantic HTML helps screen readers understand the page structure and purpose.
Can you add custom CSS or Tailwind classes to
not-found.tsx?✗ Incorrect
You can style
not-found.tsx with CSS modules, Tailwind, or any styling method you use in your app.Explain how to create and customize a
not-found.tsx page in Next.js 13+.Think about where the file goes, how it looks, and how to show it.
You got /5 concepts.
Describe accessibility best practices when designing a custom 404 page in Next.js.
Focus on how to make the page understandable and usable for everyone.
You got /5 concepts.