Replies: 10 comments 27 replies
-
|
Supporting css-in-js with RSC sounds challenging. I'm not sure how others are doing it. |
Beta Was this translation helpful? Give feedback.
-
|
Some other ideas that should work with RSC and should give you a close DX to styled-components. https://vanilla-extract.style/ If you end up trying any of these, sharing feedback for how it goes, positive or negative would be really helpful! :) |
Beta Was this translation helpful? Give feedback.
-
|
The NextJS css-in-js docs page currently says
Maybe React will add APIs to make css-in-js easier with RSC. I see styled-components offers a streaming API - https://styled-components.com/docs/advanced#streaming-rendering. Does this work inside the handleRequest part of defineEntries in a src/entries.tsx file? if (input.type === 'custom') {
// ...
const sheet = new ServerStyleSheet();
return sheet.interleaveWithNodeStream(
renderHtml(entries, sheet.collectStyles(html), { rscPath, actionResult })
);
} |
Beta Was this translation helpful? Give feedback.
-
|
Stumbled on this as well, anyone solved this? Next.js offers |
Beta Was this translation helpful? Give feedback.
-
|
Made it work without hacking |
Beta Was this translation helpful? Give feedback.
-
#1211 (comment) Basically, I think traditional css-in-js doesn't work. But, the reason it's closed is probably stale discussions. |
Beta Was this translation helpful? Give feedback.
-
|
@nihgwu Could you please explain the very high level overview for the solution? |
Beta Was this translation helpful? Give feedback.
-
|
I'm preparing the PR from my approach without hacking SSR entry |
Beta Was this translation helpful? Give feedback.
-
|
@dai-shi What's your vision to support it from Waku side? Either expose |
Beta Was this translation helpful? Give feedback.
-
|
Hope #1858 works. |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
I like css-in-js, specifically styled-components, but as I look around at my options for leveraging rsc's Next seems to be the only framework supporting turn-key style setup.
It seems as though this project is leaning towards tailwind as the defacto css library, is there intention to support other ways to style waku apps?
Here's some doc's explaining how to set things up: It refers to a cssCollector. IDK I'm confused!
https://styled-components.com/docs/advanced#server-side-rendering
https://vike.dev/css-in-js
Beta Was this translation helpful? Give feedback.
All reactions