Skip to content
tezvyn:

Next.js

87 bites tagged Next.js — interview questions with model answers, and 60-second explainers.

React & Next.js2 min read

Dockerizing Next.js with Multi-Stage Builds

Use a multi-stage Dockerfile to create lean, production-ready Next.js images. This separates build-time dependencies from the runtime environment, shrinking image size.

React & Next.js2 min read

Automating Next.js Builds and Deployments with CI/CD

CI/CD for Next.js is an automated assembly line for your app. It builds, tests, and deploys your code on every push, catching errors early. The biggest footgun is not caching build artifacts, resulting in slow, expensive pipelines.

React & Next.js2 min read

Auth.js: Full-Stack Authentication for Next.js

Auth.js simplifies full-stack authentication in Next.js, handling social logins and session management. It lets you add providers like GitHub with minimal code, abstracting away OAuth flows.

React & Next.js2 min read

Vercel: The Frontend Cloud Platform

Vercel turns your Git repo into a live, globally-scaled app. It's a CI/CD pipeline, server, and CDN in one, ideal for deploying Next.js apps with automatic previews for every PR.

React & Next.js2 min read

Auth.js: Authenticate with Custom Credentials

The Auth.js Credentials provider lets you authenticate against your own system, like a user database. It's for when OAuth isn't an option and you need full control. The footgun: you are entirely responsible for the security of the login logic.

React & Next.js1 min read

MDX in Next.js: Markdown with Superpowers

MDX lets you write in Markdown and embed interactive React components directly inside your content. Use it for blogs or docs that need more than static text, like interactive charts or code demos.

React & Next.js2 min read

Next.js Router Cache: Instant Client-Side Navigation

The Next.js Router Cache is a client-side, in-memory cache that makes navigation feel instant by storing the rendered UI of visited routes. It's why navigating with `<Link>` is fast. The footgun: it caches UI, not data, so stale content can appear.

React & Next.js1 min read

Next.js i18n Routing: URLs for a Global Audience

Next.js i18n routing maps locales to URLs, like `/en/about` or `/es/acerca-de`. It's not just text translation; it's building a site structure for each language. This improves SEO and user experience.

React & Next.js2 min read

Next.js Middleware: Your App's Edge Bouncer

Think of Next.js Middleware as a bouncer at your app's door. It runs code on the edge before a request is processed, letting you redirect, rewrite, or block it. The main footgun is forgetting it runs in a limited Edge Runtime, not a full Node.js.

React & Next.js1 min read

Optimize Loading with next/script

The `next/script` component prevents third-party scripts from blocking your page's initial render. Use it for analytics, ads, or chat widgets to improve performance. The footgun is not choosing the laziest strategy possible for non-essential scripts.

React & Next.js2 min read

Next.js Draft Mode: Previewing Static Content

Next.js Draft Mode bypasses static pages to preview unpublished content from a headless CMS. It's for content editors who need to see changes live before publishing. The footgun is security: a leaked secret token exposes all draft content.

React & Next.js2 min read

Next.js Runtimes: Edge vs. Node.js

Choose your server environment in Next.js: a fast, limited Edge function or a powerful Node.js backend. Use the Edge for low-latency tasks like auth checks; stick with Node.js for its full API set and heavier computation.

React & Next.js2 min read

Next.js: Dynamic API Segments for Flexible Endpoints

Think of dynamic API segments as URL templates. A single file like `app/api/users/[id]/route.ts` can handle requests for any user ID, from `/api/users/1` to `/api/users/99`. The footgun is forgetting to parse the ID, which is always a string.

React & Next.js2 min read

NextResponse.json(): The Standard for API Responses in Next.js

NextResponse.json() is the standard way to send JSON from Next.js Route Handlers, like Express's res.json(). Use it in app/api routes to return data; it automatically sets the correct headers.

React & Next.js1 min read

Next.js Route Handlers: One File, Multiple Methods

Think of a Next.js Route Handler file as a dedicated API endpoint. You handle different HTTP requests by exporting functions named `GET`, `POST`, `DELETE`, etc. Use them to build API routes for form submissions or to fetch data for client-side components.

React & Next.js2 min read

Partial Prerendering (PPR): Static Speed for Dynamic Pages

Partial Prerendering serves a static page shell instantly, then streams in dynamic parts. It's like getting a pre-built house frame immediately, with custom rooms delivered and slotted in as they're finished.

React & Next.js2 min read

Next.js Route Segment Config

Think of Next.js Route Segment Config as per-route dials for runtime, caching, and timeouts. Use it to run a specific API route on the Edge for speed or increase the timeout for a data-heavy page. The footgun: settings don't cascade to child routes.

React & Next.js2 min read

Dynamic Functions in Next.js

Using functions like `cookies()` or `headers()` forces a Next.js page to be rendered dynamically for each request. This is key for personalized content or pages depending on search params.

React & Next.js2 min read

generateStaticParams: Pre-building Dynamic Pages in Next.js

Think of `generateStaticParams` as a build-time guest list for your dynamic routes. It tells Next.js all possible parameters (like post slugs) upfront to pre-render static pages. The footgun: it only provides params, not the page data itself.

React & Next.js2 min read

'use client': The Boundary Between Server and Client

'use client' marks where server-only rendering ends and browser interactivity begins. Use it for components with state (`useState`), effects (`useEffect`), or event listeners (`onClick`), enabling them to run in the browser.

React & Next.js2 min read

Next.js Parallel Routes: Multiple Pages in One View

Parallel Routes render multiple independent pages within a single layout, like a split-screen dashboard. This is ideal for complex UIs where different sections need to load and be managed separately.

React & Next.js2 min read

Dynamic Rendering: On-Demand Pages in Next.js

Dynamic Rendering in Next.js generates a page's HTML on the server for each user request, ensuring fresh content. It's ideal for personalized dashboards or pages with rapidly changing data.

React & Next.js2 min read

Next.js Metadata API: Control Your Site's Preview

The Next.js Metadata API is a structured way to control your page's `<head>` for SEO and social sharing. It lets you define titles, descriptions, and Open Graph images for crawlers and link previews.

React & Next.js1 min read

error.js: Graceful Error Boundaries in Next.js

The `error.js` file acts as a UI safety net, catching runtime errors in a Next.js route segment to prevent a full app crash. Use it to display a custom error message and a "try again" button.

Get Next.js bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.