vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.42k stars 27.03k forks source link

styled-components don't rehyrdate properly in React Server Components #66646

Open blairmcalpine opened 5 months ago

blairmcalpine commented 5 months ago

Link to the code that reproduces this issue

https://github.com/blairmcalpine/styled-components-repro

To Reproduce

  1. Start the application (npm run dev)
  2. Visit localhost:3000 and click the "Green (click to switch)" element. You'll see that the color doesn't change, despite the code properly swapping to a blue style. This is because the blue style is overridden with another green style: image

This second green style is the result of two conflicting