UI-libs with real SSR
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Is there at least one UI-library that really supports SSR?
I already tried 2 libs: Chakra UI and NextUI.
Both have guideline about intallation into Next.js project.
However:
- Chakra just doesn't work properly and triggers some re-render issues.
- NextUI requires to use "use client" just to render a simple Table component with text only. This is not normal...
I also searched some topics about it on Reddit, but people don't have a solution.
I start to assume that there is no any library with SSR, since it is not easy to implement. And the single way is to not use any of them.
I already tried 2 libs: Chakra UI and NextUI.
Both have guideline about intallation into Next.js project.
However:
- Chakra just doesn't work properly and triggers some re-render issues.
- NextUI requires to use "use client" just to render a simple Table component with text only. This is not normal...
I also searched some topics about it on Reddit, but people don't have a solution.
I start to assume that there is no any library with SSR, since it is not easy to implement. And the single way is to not use any of them.
4 Replies
not sure what you mean by "real SSR" because client components are fully supported in server side rendering just fine, but in shadcn/ui components automatically have "use client" where needed so you can use them directly inside server components
Transvaal lionOP
I would like to minimize CSR.
I will explain my point with example.
Don't you think that simple table with text should be rendered on server-side? Table has no event handlers and other browser stuff. Why should it be a client component? Isn't it a problem?
If table with text could be rendered on server-side, then let's render it on server side...
If I use only some Tailwind/Boostrap/or CSS only, then I can achieve rendering a table on server side.
I will explain my point with example.
Don't you think that simple table with text should be rendered on server-side? Table has no event handlers and other browser stuff. Why should it be a client component? Isn't it a problem?
If table with text could be rendered on server-side, then let's render it on server side...
If I use only some Tailwind/Boostrap/or CSS only, then I can achieve rendering a table on server side.
component libraries tend to rely on contexts to propagate the theme of the app to the components, and to read the contexts, the table must be a client component. yes, the table can be a server component but then you will lose the ability to theme the component which is a major DX feature for many component libraries.
besides, making it a client component does not harm the application by any remarkable metric.
but yeah, you have shadcn/ui where you own the components so it's easier for you to add custom styling and theme with css without having to use contexts
besides, making it a client component does not harm the application by any remarkable metric.
but yeah, you have shadcn/ui where you own the components so it's easier for you to add custom styling and theme with css without having to use contexts
Transvaal lionOP
I forgot about theme's context.
Then CSR makes sense here.
Thank you for explanation!
Then CSR makes sense here.
Thank you for explanation!