The App Router — Files Are the Routing — Concept Check
Questions on The App Router — Files Are the Routing. A folder is a URL segment and a handful of reserved filenames give you the page, its layout, its loading state and its error boundary. There is no route configuration to write.
Questions in this quiz
8 questions on The App Router — Files Are the Routing — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.You have a folder structure with a missing 'layout.tsx' file in the root of your Next.js app directory. What is the consequence?
- AOnly the root page will render, but without layout.
- BThe app will render pages but without loading states.
- CThe app will not render any pages.
- DThe app will render but without error boundaries.
2.A developer places a 'page.tsx' file inside a folder named '_components' under 'app/problems/'. What will be the result?
- AThe page will be accessible as '/problems/_components'.
- BThe page will cause a runtime error.
- CThe page will be accessible as '/problems/components'.
- DThe page will not be publicly routable.
3.In a Next.js app, you notice that a dynamic segment '[slug]' is not rendering as expected. What could be a possible reason?
- AThe 'page.tsx' file is missing in the segment.
- BThe 'loading.tsx' file is missing in the segment.
- CThe 'layout.tsx' file is missing in the segment.
- DThe 'generateStaticParams' function is missing.
4.A developer wants to add a 404 page for the '/problems' segment. Which file should they create?
- Anot-found.tsx inside 'app/problems/'
- Berror.tsx inside 'app/'
- Cerror.tsx inside 'app/problems/'
- Dnot-found.tsx inside 'app/'
5.A developer mistakenly names a file 'page.ts' instead of 'page.tsx' in a Next.js app. What is the likely outcome?
- AThe file will be ignored silently.
- BThe app will render but with warnings.
- CThe app will throw a compilation error.
- DThe file will render without JSX.
6.What happens if you use 'useSearchParams' in a server component to read search parameters?
- AThe route remains static.
- BIt causes a build error.
- CThe route becomes dynamic.
- DIt causes a runtime error.
7.A developer wants to organize routes without affecting the URL structure. Which feature should they use?
- APrivate folders using _name
- BParallel routes using @name
- CDynamic segments using [name]
- DRoute groups using (name)
8.In a Next.js app, why might 'params' and 'searchParams' need to be awaited in version 15+?
- AThey are no longer available synchronously.
- BThey are deprecated in version 15+.
- CThey are asynchronous functions.
- DThey are Promises in version 15+.