Next.js routing, server and client components, rendering strategies, data fetching, API routes and deployment concepts.
36 cards · basic cards · AI-written, checked twice. Edit anything.
- What is the routing system in Next.js based on?
Show answer
File and folder structure in the app directory
- How do you create a dynamic route segment in Next.js?
Show answer
Use square brackets around the folder name, e.g., [id]
- What is the syntax for a catch-all route in Next.js?
Show answer
Three dots followed by a parameter name, e.g., [...slug]
- What is a route group in Next.js?
Show answer
Parentheses around folder names to organize routes without affecting the URL path
- How do you create an optional catch-all route?
Show answer
Use double square brackets, e.g., [[...slug]]
- What does the app directory replace in Next.js?
Show answer
The pages directory from earlier Next.js versions
- What is the default type of component in Next.js app directory?
Show answer
Server component
- How do you mark a component as a client component in Next.js?
Show answer
Add 'use client' directive at the top of the file
- Can you use React hooks like useState in a server component?
Show answer
No, hooks only work in client components
- When should you use server components instead of client components?
Show answer
For database access, sensitive operations, and large dependencies
- What does SSR stand for in Next.js?
Show answer
Server-Side Rendering
- What does SSG stand for in Next.js?
Show answer
Static Site Generation
- What does ISR stand for in Next.js?
Show answer
Incremental Static Regeneration
- When is a page statically generated in Next.js?
Show answer
At build time
- What capability does Incremental Static Regeneration (ISR) provide?
Show answer
Revalidate and regenerate static pages without a full rebuild