T
TanStack•6mo ago
ambitious-aqua

css-in-js

There is a way to active ssr for css in js? In next js we have useServerInsertedHTML or we can check here https://nextjs.org/docs/app/building-your-application/styling/css-in-js, any same method for tanstack start?
8 Replies
metropolitan-bronze
metropolitan-bronze•6mo ago
have you tried pandacss ?
ambitious-aqua
ambitious-aquaOP•6mo ago
Not yet, but it will work with something like mui?
like-gold
like-gold•6mo ago
There is an example for mui, working with ssr
like-gold
like-gold•6mo ago
ambitious-aqua
ambitious-aquaOP•6mo ago
I try to use same method like how mui work in antd but still not working I got really bad flashing style I try to translate this next registry into tanstack start https://github.com/ant-design/nextjs-registry/blob/main/src/AntdRegistry.tsx
GitHub
nextjs-registry/src/AntdRegistry.tsx at main · ant-design/nextjs-r...
Style registry of Ant Design for Nextjs. Contribute to ant-design/nextjs-registry development by creating an account on GitHub.
eastern-cyan
eastern-cyan•5mo ago
were you able to figure out the solution? based on the above, I just tried wrapping everything under my <body> with this, and it seems to work 🤔 although I am not really sure how and if this is the right way to do it
import { ConfigProvider } from "antd";
...
<body>
<ConfigProvider
theme={{
hashed: false,
}}
>
...
</ConfigProvider>
</body>
import { ConfigProvider } from "antd";
...
<body>
<ConfigProvider
theme={{
hashed: false,
}}
>
...
</ConfigProvider>
</body>
other-emerald
other-emerald•5mo ago
best way is to not use it
ambitious-aqua
ambitious-aquaOP•5mo ago
No yet @kc , your solution only work with client only, but you will get a lot of flash unstyled, because of different between server and client If you have enterprise application and small team antd is the best and faster way to build that project, is not about is bad or we need use tailwind or anything, as programmer work in small team it really help us

Did you find this page helpful?