JS Guide
HomeQuestionsTopicsCompaniesResources
BookmarksSearch

Built for developers preparing for JavaScript, React & TypeScript interviews.

ResourcesQuestionsSupport
HomeQuestionsSearchProgress
HomeTopicsnextjs

nextjs

Next.js app router, SSR, and full-stack patterns

0 of 12 topics read0%

4 Topics

intermediate
Route Handlers & API Routes
intermediate
10 min
Next.js App Router uses Route Handlers (route.ts files exporting HTTP method functions like GET, POST) instead of Pages Router API routes — they use standard Web APIs (Request/Response), support streaming, run only on the server, and are the way to build API endpoints when Server Actions aren't appropriate.
Server & Client Components
intermediate
10 min
In the App Router, all components are Server Components by default — they render on the server with zero client JavaScript, can directly access backend resources, and pass serializable props to Client Components marked with 'use client' that handle interactivity (state, effects, event handlers).
Data Fetching
intermediate
10 min
In the App Router, Server Components are async functions that fetch data directly using fetch() or database queries — parallel fetching with Promise.all avoids waterfalls, request deduplication prevents redundant calls, and client-side fetching uses SWR or React Query for interactive data needs.
File-Based Routing
intermediate
12 min
Next.js App Router uses the app/ directory where folder structure defines URL routes — page.tsx makes a route public, layout.tsx wraps child routes with shared UI, loading.tsx and error.tsx provide automatic loading/error states, and dynamic segments like [id] capture URL parameters.