Routing & Pages — Series 2

Preview — 3 of 10 questions

By default, what kind of component is every file inside the app/ directory?

AA Server Component — a file is a Server Component unless it (or a module in its import chain) starts with "use client"
BIt depends on whether the file is TypeScript or JavaScript
CA Client Component — you opt into Server Components with "use server"
DA Client Component if the file has a default export, a Server Component otherwise

How do nested layouts compose in the App Router?

javascript
app/layout.tsx          (root)
app/dashboard/layout.tsx
app/dashboard/page.tsx
AOnly the innermost layout.tsx renders; outer layouts are ignored
BLayouts nest automatically — the root layout wraps the dashboard layout, which wraps page.tsx. Each layout receives children and stays mounted across navigations within its segment
CYou must import and render the root layout inside every nested layout
DA nested layout replaces the root layout when you navigate deeper

When does next/link prefetch a linked route by default?

ANever — you must set prefetch={true}
BOnly after the user clicks the link
CAutomatically, in production, when the <Link> enters the viewport — so the transition feels instant on click
DOnly in development, to speed up local testing

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.