vercel / next.js

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

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

Open blairmcalpine opened 1 month ago

blairmcalpine commented 1 month 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