Replies: 3 comments 1 reply
-
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.
-
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