BitlystBitlyst
PostsSeriesTopicsAbout

Bitlyst

Short, diagram-first posts on JavaScript, React & Next.js. Follow via RSS or the newsletter.

© 2026 Mohsen Fallahnejad

PostsSeriesTopicsLinksAboutRSSGitHubX
← All topics

#nextjs

16 posts

Scrolling My Blog Index Prefetched All 51 Posts. One Config Line Cut It to 90 kB.

What a long list of Next.js <Link>s really costs in prefetch requests, measured on this blog, and how partialPrefetching shares one App Shell per route instead.

Nov 3, 20264 min read

The Server Action That Ran Twice, but Only on localhost

Why a Next.js Server Action called from useEffect runs twice in development: React Strict Mode mounts every component twice. What that reveals, and where the call belongs.

Nov 3, 20264 min read

One Line in My Root Layout Turned 158 Static Pages Into 0

Reading a cookie with cookies() in the Next.js root layout opts every route out of static rendering. What it cost this blog, measured, and how to fix a theme flash without it.

Nov 1, 20267 min read3

I Optimized a Button From O(n) to O(1). The Speed Didn't Matter.

A bug report, a route map, and three rounds of making it faster — a story about what Big O really measures, why constants win at small n, and why the best algorithm is sometimes deleting the question.

Oct 31, 202610 min read6

CORS Explained Simply — Why Your Fetch Works in Postman but Fails in the Browser

Cross-Origin Resource Sharing in plain language: what blocks your request, what preflight means, and how to fix the errors you'll see in every frontend job.

Jul 8, 20266 min read3

CDN Explained: What It Is, How It Works, and How to Use It in Next.js

A CDN speeds up your app by serving assets from servers close to your users. Here's how it works and how Next.js takes advantage of it.

Jun 20, 20263 min read2

Understanding HttpOnly Cookies in Depth

How HttpOnly cookies work, why they're essential for security, and how to use them safely in Next.js and Express.

Oct 14, 20253 min read1

Prefetching in Next.js Links Explained

How Next.js prefetch works in <Link>, why it makes navigation fast, and when to disable it.

Oct 4, 20252 min read

Why MUI Avoids Theme Flash on First Load (Dark/Light Mode)

How MUI applies the correct color scheme on the very first paint, and why other UI kits often flash light before switching to dark.

Sep 29, 20253 min read1

Why setState Doesn’t Cause Hydration Errors

Understanding why calling setState after hydration doesn’t produce hydration mismatches in React/Next.js.

Sep 26, 20252 min read

How useState Works Under the Hood (and Why It Needs use client)

Deep dive into React's useState, how it works internally, and why client components are required in Next.js App Router.

Sep 23, 20254 min read

What is 'use client' in Next.js?

Understand 'use client' in Next.js App Router: what it means, when to use it, and how it works under the hood.

Sep 23, 20252 min read

Next.js Page Router vs App Router

Understand the key differences between the old Page Router and the new App Router in Next.js.

Sep 23, 20252 min read

Next.js App Router Caching — Cheat Sheet

A compressed reference of Next.js caching layers and controls (App Router).

Sep 20, 20252 min read

When Should You Use Dynamic Import in React/Next.js? (With Performance Comparison)

A practical guide to dynamic imports with real-world examples and a before/after bundle-size comparison using next-bundle-analyzer.

Sep 17, 20253 min read1

MVVM, Micro‑Frontends, and Domain‑Driven Frontend — A Practical Guide

Clear, practical explanations of MVVM, micro‑frontends, and domain‑driven design for modern React/Next.js teams, with examples, folder structures, and trade‑offs.

Sep 15, 20256 min read

Related topics

#react#performance#frontend#app-router#caching#cookies#hydration#link