CCelestiallines.com

Next.js Articles

Notes on PHP, Drupal, Laravel, React, and Next.js development.

Next.js Image Optimization Best Practices

Jun 2026

Next.js Image Optimization Best Practices

next/image done right: what the component actually solves versus a plain <img>, the fill prop for CSS-driven sizing, priority for the LCP image specifically, configuring remotePatterns for CMS-hosted images, the sizes prop for responsive layouts, and local vs remote image import differences.

Read more →
Next.js Server Actions: Complete Guide with Examples

Jun 2026

Next.js Server Actions: Complete Guide with Examples

Next.js Server Actions in depth: defining them with 'use server', using them directly as a form's action (works without client JS), revalidating the cache after a mutation, pending/error state with useFormStatus and useActionState, calling actions outside forms, and why they need their own server-side authorization checks.

Read more →
Next.js vs React: What's the Difference and When to Use Each

Jun 2026

Next.js vs React: What's the Difference and When to Use Each

Clearing up the React vs Next.js framing: React is a UI library, Next.js is a framework built on it adding routing, SSR/SSG, and Server Components. What you lose without a framework, when plain React still makes sense, and a practical rule of thumb.

Read more →
How to Fix Hydration Errors in Next.js

Jun 2026

How to Fix Hydration Errors in Next.js

Every real cause of Next.js/React hydration errors — non-deterministic values (Date.now, Math.random), reading browser-only globals during render, browser extensions modifying the DOM, invalid HTML nesting, and locale/timezone formatting differences — plus a systematic diagnosis process.

Read more →
Next.js SEO Best Practices for Better Search Rankings

Jun 2026

Next.js SEO Best Practices for Better Search Rankings

Next.js SEO done properly: server-rendering content instead of client-only fetching, the Metadata API and generateMetadata() for per-page uniqueness, canonical URLs, JSON-LD structured data, dynamic sitemap.ts/robots.ts, why internal links matter more than the sitemap alone, and Core Web Vitals.

Read more →
Next.js App Router vs Pages Router: What You Need to Know

Jun 2026

Next.js App Router vs Pages Router: What You Need to Know

App Router vs Pages Router in Next.js: file convention differences, Server Components by default, persistent nested layouts, the fundamentally different data-fetching model (async Server Components vs getServerSideProps/getStaticProps), streaming with Suspense, and whether migrating an existing app is worth it.

Read more →