react-selective-hydration

Enable selective hydration for React 18 streaming SSR pages.

Updated May 20, 2026
One-click install
npx skills add https://github.com/Hollowvyn/cognipace-v2 --skill react-selective-hydration-hollowvyn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-selective-hydration
Source: https://github.com/Hollowvyn/cognipace-v2/tree/main/.agents/skills/react-selective-hydration
Command: npx skills add https://github.com/Hollowvyn/cognipace-v2 --skill react-selective-hydration-hollowvyn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It reduces slow time-to-interactivity in SSR React pages by preventing slow or data-fetching components from blocking hydration of the rest of the UI.

Core Features & Use Cases

  • Selective hydration with React 18+: Hydrates interactive components as soon as their HTML and JS are available, rather than waiting for the entire page.
  • Streaming SSR via Suspense boundaries: Uses streaming rendering APIs (renderToPipeableStream/renderToReadableStream) so independently ready parts of the tree can be sent to the client earlier.
  • Practical SSR performance use case: Wraps slow components (e.g., data-fetching UI) in Suspense so sibling interactive components can hydrate and respond sooner.

Quick Start

Apply Suspense boundaries around independently hydratable UI chunks and switch your SSR to streaming (renderToPipeableStream or renderToReadableStream) so hydrateRoot can progressively activate the parts that are ready.

Frequently Asked Questions about react-selective-hydration

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

FAQPage Schema
How do I prevent slow components from blocking React SSR hydration?

Prevent slow components from blocking React SSR hydration by wrapping them in Suspense boundaries. This enables selective hydration, allowing ready components to hydrate independently rather than waiting for the entire page to load.

How does selective hydration work with React 18 streaming SSR?

Selective hydration works with React 18 streaming SSR by using renderToPipeableStream or renderToReadableStream to send ready HTML chunks progressively. hydrateRoot then attaches interactivity to each Suspense-delimited region as it arrives.

Do I need React 18 hydrateRoot to enable progressive hydration?

Yes, you need React 18 hydrateRoot to enable progressive hydration. It progressively activates interactive UI regions as their HTML and JavaScript become available, which is required for the selective hydration process to function.

What is the best way to hydrate interactive React UI early with streaming SSR?

The best way to hydrate interactive React UI early is by combining streaming SSR APIs with Suspense boundaries. This approach lets independently ready UI chunks hydrate as soon as their data is available, bypassing slow components.

When should I not use selective hydration for my React application?

You should not use selective hydration when your React application lacks independently hydratable UI regions or slow data-fetching components. Without distinct Suspense boundaries, streaming SSR provides no hydration bottleneck reduction.