react-selective-hydration

Enable selective hydration in React 18 streaming SSR with Suspense boundaries.

235|25|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/PatternsDev/skills --skill react-selective-hydration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-selective-hydration
Source: https://github.com/PatternsDev/skills/tree/main/react/react-selective-hydration
Command: npx skills add https://github.com/PatternsDev/skills --skill react-selective-hydration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Server-rendered React pages often render a non-interactive shell until the full JavaScript bundle loads, delaying interactivity. Selective hydration enables hydrating only the critical interactive parts first while the rest of the page streams, improving perceived performance and time-to-interactive.

Core Features & Use Cases

  • Enables streaming SSR with Suspense boundaries to hydrate critical components early.
  • Utilizes renderToPipeableStream or renderToReadableStream and hydrateRoot to progressively hydrate UI as data becomes available.
  • Applies to large pages where certain widgets must become interactive quickly while other sections render progressively for better user experience.

Quick Start

Start by integrating selective hydration in your React 18 SSR setup and ensure critical components are wrapped in Suspense boundaries.

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 server-side rendering performance in React 18?

Selective hydration in React 18 enables hydrating critical interactive components first while non-critical page sections render progressively, reducing time-to-interactive and allowing user interactions before the full JavaScript bundle loads.

How do I set up streaming SSR with Suspense boundaries to hydrate components early?

To hydrate components early, wrap critical interactive components in Suspense boundaries and use renderToPipeableStream or renderToReadableStream for the server render, then pair it with hydrateRoot on the client to progressively hydrate the UI as data becomes available.

Can I use selective hydration without React 18?

No, selective hydration requires React 18 or higher because it relies on concurrent rendering features, Suspense boundaries for streaming SSR, and the hydrateRoot API to prioritize and hydrate critical components before the full page loads.

What is the best way to prioritize interactive widgets during server-side rendering?

The best way to prioritize interactive widgets during server-side rendering is wrapping them in Suspense boundaries to enable selective hydration, which ensures critical components hydrate first while the rest of the page streams progressively.

When should I not use streaming SSR with selective hydration?

You should avoid streaming SSR with selective hydration for small pages where the full JavaScript bundle loads instantly, as the overhead of Suspense boundaries and hydrateRoot provides no perceived performance benefit when there are no non-critical sections rendering progressively.