suspense-patterns

Design React Suspense boundaries to prevent waterfall fetches and fallback flicker.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/jacob-balslev/skill-graph --skill suspense-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: suspense-patterns
Source: https://github.com/jacob-balslev/skill-graph/tree/main/marketplace/skills/suspense-patterns
Command: npx skills add https://github.com/jacob-balslev/skill-graph --skill suspense-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design React loading behavior so your UI streams smoothly instead of blocking on the slowest part or flashing fallbacks on updates.

Core Features & Use Cases

  • Boundary placement for loading granularity: decide which parts should share a fallback and which parts should load independently.
  • Suspense + ErrorBoundary pairing: structure failure and loading modes correctly so errors don’t leave you stuck in a loading state.
  • Flicker-free updates with transitions: use startTransition/useTransition to keep previously-rendered content visible while new data loads.
  • Parallel vs waterfall avoidance: prevent sequential fetching by starting independent work at the same tree level.
  • React 18+ and React 19 use hook coverage: handle both thrown-Promise Suspense and use(promise) patterns across Server/Client boundaries, including Next.js App Router loading.tsx.

Quick Start

Use suspense-patterns to review your React Suspense and ErrorBoundary placement for a streaming Next.js page, and rewrite it so slow sections stream independently without waterfall fetching or fallback flicker.

Frequently Asked Questions about suspense-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I place React Suspense boundaries to prevent waterfall fetches and fallback flicker?

Place React Suspense boundaries by grouping independent data fetches at the same tree level to preserve parallel fetching, and wrap updating components separately to prevent fallback flicker during re-renders.

Why does my Next.js App Router loading.tsx leave content stuck in a loading state after an error?

Your Next.js App Router loading state gets stuck because Suspense boundaries must be paired with ErrorBoundary components; without an ErrorBoundary, a thrown Promise rejection during streaming leaves the UI suspended indefinitely instead of rendering the fallback error UI.

How do I keep previously-rendered content visible in React while new data loads?

Keep previously-rendered content visible by wrapping data fetches in startTransition or useTransition; this separates non-urgent updates, allowing React to show the current page while the new data resolves instead of flashing a Suspense fallback.

How does React 19 use hook work with Suspense for promises across Server and Client components?

The React 19 use hook integrates with Suspense by allowing components to unwrap thrown promises directly; apply boundary placement rules to handle use(promise) patterns across Server and Client component setups, ensuring streaming works without layout regressions.

When should I not use a Suspense boundary for code-splitting in a React component tree?

Avoid using a Suspense boundary for code-splitting when it encloses sections with critical SEO content or when it groups components with different loading granularities, as this causes unnecessary layout shifts and delays interactive elements while waiting for the slowest chunk.