CSS in React Server Components
summary
React Server Components break runtime CSS-in-JS patterns: styled-components and emotion rely on context and client-side effects to inject styles, so server components force many files to be marked use client, losing server benefits. A working registry + use server inserted HTML approach collects hashed classnames and injects style tags on SSR so hydration avoids FOUC, but it means refactoring large codebases — one real example has 5,500 styled instances. The viable long-term path is compile-time CSS (Linaria, Panda, Pigment, NextYak) which preserves styled APIs without runtime.
AI-written summary · about
