<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Cong-Cong Pan</title>
    <description>The latest articles on Forem by Cong-Cong Pan (@symind).</description>
    <link>https://forem.com/symind</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3881544%2F2af549a2-fc8d-4789-a1c1-956f1d34af83.jpeg</url>
      <title>Forem: Cong-Cong Pan</title>
      <link>https://forem.com/symind</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/symind"/>
    <language>en</language>
    <item>
      <title>How to handle CSS preloading for Client Components in an RSC + SSR setup?</title>
      <dc:creator>Cong-Cong Pan</dc:creator>
      <pubDate>Thu, 16 Apr 2026 03:31:49 +0000</pubDate>
      <link>https://forem.com/symind/how-to-handle-css-preloading-for-client-components-in-an-rsc-ssr-setup-3p4j</link>
      <guid>https://forem.com/symind/how-to-handle-css-preloading-for-client-components-in-an-rsc-ssr-setup-3p4j</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;I've been diving deep into custom React Server Components (RSC) and Server-Side Rendering (SSR) implementations, and I've run into a frustrating issue regarding CSS management for Client Components.&lt;/p&gt;

&lt;p&gt;When using the &lt;code&gt;renderToReadableStream&lt;/code&gt; API to render Server Components, we can pass a &lt;code&gt;clientManifest&lt;/code&gt; (or module map) so the browser knows exactly which JavaScript resources to load for the Client Components. This handles the JS side perfectly.&lt;/p&gt;

&lt;p&gt;However, I haven't been able to find a built-in solution or a clear pattern for handling the CSS resources associated with those Client Components—essentially, there seems to be no standard equivalent to a preinitCssForSSR approach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because there is no explicit way to map and pre-initialize the CSS assets during the RSC -&amp;gt; SSR pass, the styles aren't immediately available when the HTML is sent to the client.&lt;/p&gt;

&lt;p&gt;When the Client Component ultimately hydrates and renders in the browser, the stylesheet has to be fetched/applied post-render, which causes a highly noticeable Flash of Unstyled Content (FOUC).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Questions for the Community:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How are you handling CSS asset mapping for Client Components in a custom RSC setup?&lt;/p&gt;

&lt;p&gt;Is there a specific bundler plugin (Webpack/Vite) or a manifest-generation strategy you use to extract these CSS dependencies and inject them as  tags in the initial SSR HTML?&lt;/p&gt;

&lt;p&gt;Are there any undocumented APIs or established community patterns to achieve a preinitCssForSSR effect?&lt;/p&gt;

&lt;p&gt;Any insights, architectural advice, or code snippets would be hugely appreciated. Thanks in advance!&lt;/p&gt;

</description>
      <category>react</category>
    </item>
  </channel>
</rss>
