Promises as Props (React 19+)
You'll learn how React 19+ lets you pass raw promises from server to client components, where the client can unwrap them asynchronously using the use() hook.
The Core Idea
In earlier React patterns, if a server component fetched data, it had to await the promise and pass the resolved value to client components. With React 19's use() hook, you can now pass the promise itself as a prop, and the client component unwraps it when needed.
This works because promises are serializable across the server-client boundary (they get special treatment, unlike regular functions). The server initiates the fetch, but the client can "subscribe" to its resolution.
Why This Matters
// Server Component
async function ServerParent() {
const dataPromise = fetchUserData(); // Don't await!
return <ClientChild userPromise={dataPromise} />;
}
// Client Component
'use client';
import { use } from 'react';
function ClientChild({ userPromise }) {
const user = use(userPromise); // Unwrap the promise
return <div>Welcome, {user.name}!</div>;
}
The server starts the fetch but doesn't block rendering. The client receives the promise and suspends until it resolves. This enables parallel data fetching where the server can kick off multiple requests and let the client handle their completion.
The Mental Model
Think of it like ordering food: the server (kitchen) starts cooking but hands you a receipt (promise) immediately. You (client component) wait with that receipt until the food is ready, but you don't block the kitchen from starting other orders.
Key Takeaway: React 19+ treats promises as serializable props, letting server components initiate async work and client components unwrap it with use(), enabling new patterns for parallel data fetching across the boundary.