react-selective-hydration

Enable selective hydration in React 18 apps with Suspense and streaming SSR.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI --skill react-selective-hydration-quanngynx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-selective-hydration
Source: https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI/tree/main/servexa-warranty-ai/.agents/skills/react-selective-hydration
Command: npx skills add https://github.com/quanngynx/GDGO-2026.Servexa-Warranty-AI --skill react-selective-hydration-quanngynx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Selective hydration reduces time-to-interactivity for server-rendered React apps by preventing slow components from blocking hydration of the rest of the page.

Core Features & Use Cases

  • Selective hydration with React 18: Hydrate interactive parts as soon as their markup and JavaScript are available instead of waiting for the entire bundle to load.
  • Streaming SSR: Stream HTML progressively with renderToPipeableStream (Node) or renderToReadableStream (edge) to improve perceived performance.
  • Suspense-delimited UI chunks: Use Suspense boundaries so data-fetching or slow components don’t delay sibling hydration.

Use case example: In an SSR landing page, you can keep hero and call-to-action components interactive immediately while deferring a slower Comments section until its data and markup are ready.

Quick Start

Use Suspense boundaries around slow components, stream the HTML with renderToPipeableStream or renderToReadableStream, and hydrate with hydrateRoot to start interacting before all components are ready.

Frequently Asked Questions about react-selective-hydration

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

FAQPage Schema
How does selective hydration improve React 18 SSR performance?

Selective hydration prevents slow data-fetching components from blocking hydration of the rest of a React 18 server-rendered page. It reduces time-to-interactivity by allowing interactive parts to hydrate as soon as their markup and JavaScript are available.

How do I implement streaming SSR with Suspense in React?

To implement streaming SSR with Suspense in React, wrap slow components in Suspense boundaries, stream HTML progressively using renderToPipeableStream or renderToReadableStream, and hydrate the client with hydrateRoot to enable selective hydration.

What are the prerequisites for using selective hydration in a React app?

Prerequisites for selective hydration include a React 18 SSR application utilizing Suspense boundaries to delimit UI chunks, streaming APIs like renderToPipeableStream, and hydrateRoot for client hydration.

Can I hydrate a React component before the entire page markup is ready?

Yes, you can hydrate a React component before the entire page markup is ready by using streaming SSR. This delivers HTML progressively, enabling immediate hydration and interactivity for available components while others wait for data.

When should I not use selective hydration for server-rendered React apps?

You should avoid selective hydration when your SSR React app lacks Suspense boundaries or streaming APIs. If your app does not use renderToPipeableStream or hydrateRoot, this selective hydration optimization cannot be applied.