Server Components Refetch Without Losing Client State
You'll learn how React preserves the state of your interactive Client Islands when Server Components refetch, making the model feel seamless.
The Seamless Update Illusion
One of React Server Components' most elegant features is that when you navigate or refresh Server Components, Client Islands maintain their state. If you have a counter in a client component showing "5", and the parent Server Component refetches new data from the database, that counter stays at "5". No reset, no flash, no lost work.
This happens because React treats Server and Client Components as separate layers. When Server Components refetch:
- The server sends new RSC wire format data
- React reconciles this new server tree with the existing client tree
- Client Island boundaries act as "state anchors"
- Only the server-rendered parts update; client state is untouched
Why This Matters
Imagine a page with:
- A Server Component displaying blog posts (fetched from DB)
- A Client Island with a search input (user typing)
- Another Client Island with an open dropdown menu
When you navigate to page 2 of posts, the Server Component refetches. Without this feature, the search input would clear and the dropdown would close—terrible UX. Instead, React preserves both pieces of client state while seamlessly updating the post list.
This is the "islands architecture" paying dividends: because Client Islands are explicit boundaries with 'use client', React knows exactly where interactive state lives and protects it during server refetches.
Key Takeaway: React Server Components can refetch and update server-rendered content while preserving all client state in your interactive islands, making navigation feel instant and stateful without losing user context.