shubhradev

shubhradev

@shubhra.dev

Building shubhra.dev - a developer platform for production-grade React & Next.js. Practical tutorials, reusable code snippets, interactive quizzes, developer tools, and free resources to help developers build, ship, and maintain real-world applications.

7 followers6 following33 posts

I fired 20 requests at a Node.js handler. Every client left after 100 ms, but the server still ran all 100 steps. With a disconnect check: 0 of 100. pg 8.23.1 accepts { signal } but ignores it. dev.to/shubhradev/a...

7 React 19 Suspense mistakes that break production • Expecting it to fetch • useEffect suspension • Recreating Promises on render • 1 global boundary • Too many tiny boundaries • Misunderstanding Transitions • Using it for error handling Read Deep Dive 👇 shubhra.dev/tutorials/re...

shubhra.devReact 19 Suspense Explained: What Actually Happens When a Component SuspendsPart 6 of React 19 Deep Dive: understand Suspense boundaries, nested loading states, streaming SSR, use(), and transitions through practical experiments.

2/3 It covers: ⚡ What activates (and DOES NOT activate) a boundary ⚡ Reading Promises with use() ⚡ Boundary ownership & 300ms reveal rule ⚡ Suspense + Transitions & View Transitions ⚡ Error Boundaries, Streaming SSR & Accessibility ⚡ TypeScript types & common mistakes

3/4 This is why putting fetch() inside useEffect() + wrapping in <Suspense> fails to trigger the fallback. useEffect fires post-render. If React can't observe the pending Promise during render, Suspense stays silent.

2/4 Here is what's actually happening: • Something provides a suspension signal (like use() reading a pending Promise or React.lazy()). • Suspense observes this during rendering and decides what to show while waiting.

Next.js 16 Authentication Architecture 🛠️ A minimal, self-hosted auth foundation without heavy external libraries. Uses bcrypt, JWTs, httpOnly cookies, proxy middleware, and PostgreSQL. Completely free & open-source (MIT). Full scaffold & setup: shubhra.dev/products/nex...

Stop making users wait for server roundtrips ⏳ Optimistic UI updates instantly: 1️⃣ User clicks 2️⃣ UI updates immediately 3️⃣ Server processes 4️⃣ Confirmed (✓) or rolled back (↩) Here's Next.js useOptimistic full implementation guide: shubhra.dev/tutorials/ne...

generateStaticParams() doesn't protect you from uncached data. In my Next.js 16 + Cache Components test: Known params + uncached data → build error The reason is simple: knowing the URL params doesn't mean the data can be prerendered. Full test: shubhra.dev/tutorials/ne...

shubhra.devgenerateStaticParams Doesn't Make Your Route Static. Neither Does Fixing Only the PageI tested what happens with generateStaticParams, nested Suspense boundaries, and shared layouts under Cache Components. I built a four-route test project and ran all of it. One case took three attempt...

generateStaticParams() tells Next.js which paths are known at build time. It does NOT automatically make their data static. With Next.js 16 Cache Components, generateStaticParams, "use cache" and <Suspense> solve different problems. I tested the behavior: shubhra.dev/tutorials/ne...

shubhra.devgenerateStaticParams Doesn't Make Your Route Static. Neither Does Fixing Only the PageI tested what happens with generateStaticParams, nested Suspense boundaries, and shared layouts under Cache Components. I built a four-route test project and ran all of it. One case took three attempt...

React 19 useTransition gotcha: After await, the code is no longer inside the original Transition context. So this: await save(); setState(...) needs another startTransition() if that update must remain part of the Transition. shubhra.dev/tutorials/re...

shubhra.devReact 19 useTransition Explained: Race Conditions, Async UI & Pending StatePart 5 of React 19 Deep Dive: learn useTransition, async UI, pending state, error handling, and how to prevent stale results from out-of-order requests.

useTransition looks simple until async work enters the picture. await can break Transition context. Rapid requests can race. Errors need an Error Boundary. Controlled inputs shouldn't be transitioned. I tested all of these in React 19. shubhra.dev/tutorials/re...

shubhra.devReact 19 useTransition Explained: Race Conditions, Async UI & Pending StatePart 5 of React 19 Deep Dive: learn useTransition, async UI, pending state, error handling, and how to prevent stale results from out-of-order requests.

Next.js 16 Cache Components trap: Your page doesn't call cookies(). Your build still fails because a shared layout does. The error can point at the page while the problem is higher in the layout tree. shubhra.dev/tutorials/ne...

shubhra.devEvery Way I Could Break Next.js Cache Components (and the Real Fix for Each One)I deliberately broke Next.js Cache Components on a real 16.3 project. Six triggers, three fixes, and what each choice actually changes in your build output.

A login form isn't a production-ready auth system. The Next.js 16 Auth Kit uses 3 security layers: Proxy → Server Components → Data Layer. Plus OAuth, email verification, password reset, RBAC, admin functionality, rate limiting & secure httpOnly cookies. shubhra.dev/products/nex...

shubhra.devNext.js 16 Auth Kit: OAuth, Email Authentication & Role-Based AccessProduction-ready Next.js 16 auth kit: email/password, Google & GitHub OAuth, verification, reset, roles, admin panel. Three-layer security model.

React 19 Actions didn't replace forms. They changed where the complexity lives. React handles much of the submission plumbing, but validation, error UX, optimistic UI, authorization and security still require engineering judgment. A deeper look at what changed: shubhra.dev/blog/react-1...

shubhra.devReact 19 Actions Didn't Replace Forms. They Changed Where the Complexity Lives.React 19 Actions don't replace forms. See what useActionState simplifies, what complexity remains, and how Actions compare with onSubmit in real forms.

React 19's useActionState, useOptimistic, useFormStatus, and useTransition can look like four unrelated APIs when learned separately They're actually different ways of working with Actions and Transitions We put the whole model together in Part 4 of React 19 Deep Dive shubhra.dev/tutorials/re...

shubhra.devReact 19 Actions Explained: How the 4 APIs Fit TogetherPart 4 of React 19 Deep Dive: what Actions are, form action vs onSubmit, sync vs async Actions, and how useActionState, useOptimistic, useFormStatus, and useTransition connect.

Authentication isn't difficult because of the login form. It's difficult because of everything that comes after. OAuth. Email verification. Password reset. Roles. Sessions. Security. We packaged all of that into a production-ready Next.js 16 Auth Kit. 🔗 shubhra.dev/products/nex...

shubhra.devNext.js 16 Auth Kit: OAuth, Email Authentication & Role-Based AccessProduction-ready Next.js 16 auth kit: email/password, Google & GitHub OAuth, verification, reset, roles, admin panel. Three-layer security model.

New tutorial published React 19's useFormStatus simplifies pending UI for forms without passing loading state through multiple components. This tutorial explains how it works, when to use it, common mistakes, and production-ready patterns. shubhra.dev/tutorials/re...

shubhra.devReact 19 useFormStatus Explained: Read Form Status From Any Child Component Without Prop DrillingLearn React 19 useFormStatus through practical examples, the pending-always-false bug nearly everyone hits first, and how it actually differs from useActionState's own isPending.

Container Queries changed how I approach responsive UI. Components now respond to their own container instead of the viewport. What's the CSS feature that most changed your workflow?

You are up to date.