Blog

Modern React patterns in Next.js 16

When to Use Client Components
March 5, 2026 · 1 min read

Server vs Client Components, CSS :has() for parent styling, data-pending attribute pattern.

Streaming with Suspense
March 5, 2026 · 1 min read

Streaming with Suspense boundaries, co-locating skeleton components with their data.

Server Functions with Zod
March 5, 2026 · 1 min read

Server Functions with "use server", Zod validation, returning errors, cache invalidation.

useActionState for Form Errors
March 5, 2026 · 1 min read

Preserve form input on validation errors, reuse forms for create and edit with .bind().

useFormStatus in SubmitButton
March 5, 2026 · 1 min read

SubmitButton component pattern, why it must be a child of the form.

useOptimistic Updater Pattern
March 5, 2026 · 2 min read

Updater functions for rapid clicks, data-pending for parent styling, ArchiveButton pattern.

Caching with use cache
March 5, 2026 · 2 min read

Opt-in caching with "use cache", revalidateTag + refresh() for invalidation.

View Transitions API
March 5, 2026 · 1 min read

Page-level enter/exit animations, shared element transitions with name + share="morph".

Error Handling Patterns
March 5, 2026 · 1 min read

error.tsx with reset(), not-found.tsx with notFound(), error boundary placement.

generateStaticParams
March 5, 2026 · 1 min read

Pre-render dynamic routes, generateMetadata for SEO, on-demand generation for new slugs.

URL State with searchParams
March 5, 2026 · 2 min read

Shareable filter/sort state, preserving params on update, cycle button with optimistic UI.

cache() for Deduplication
March 5, 2026 · 1 min read

Request deduplication with cache(), combining with "use cache" for cross-request caching.

useTransition for Pending UI
March 5, 2026 · 1 min read

isPending for delete buttons, nested startTransition for state updates after await.

Skeleton Co-location Pattern
March 5, 2026 · 1 min read

Export skeletons alongside components, match layout structure, use with Suspense.

Authorization with unauthorized()
March 5, 2026 · 1 min read

unauthorized() in Server Components, unauthorized.tsx files, protecting Server Functions.

Static vs Dynamic Rendering
March 5, 2026 · 1 min read

What triggers dynamic rendering, when Suspense shows fallbacks, updateTag() for ISR.

The Action Prop Pattern
March 5, 2026 · 1 min read

Parent passes async function, child owns useTransition, design/SubmitButton pattern.

useLinkStatus for Navigation
March 5, 2026 · 2 min read

Track Link pending state, SortButton pattern, prefetch={false} for visible feedback.