MUI deprecetad with app folder and server components ?
Unanswered
DollarNavalex posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/99023314038583296/2d36eda577fea6a5faf89948e592f23c.webp?size=256)
DollarNavalexOP
Hey guys,
I'm trying to migrate a website to the new app directory, but I'm using MUI actively on all the website, and any import from MUI seems to needs a client components.
So my question is simple: does MUI is still a viable choice for Next.js ? Is there other libs that can better fit in this engine without leaving too much from MUI design and components ?
Thanks
I'm trying to migrate a website to the new app directory, but I'm using MUI actively on all the website, and any import from MUI seems to needs a client components.
So my question is simple: does MUI is still a viable choice for Next.js ? Is there other libs that can better fit in this engine without leaving too much from MUI design and components ?
Thanks
19 Replies
![Avatar](https://cdn.discordapp.com/avatars/194128415954173952/708a8637ada505b6b7a85972807d9dca.webp?size=256)
Alfonsus Ardani
yes
however its not fully supported yet in app dir, coz it uses emotion, which is css-in-js
you can still SSR apps that use MUI
![Avatar](https://cdn.discordapp.com/avatars/99023314038583296/2d36eda577fea6a5faf89948e592f23c.webp?size=256)
DollarNavalexOP
Yeah i think i didn't get everything with the new server components
Is just components which can do api calls etc server side ?
If i get it, even a client component can still be SSR ?
It just be populated client-side with my useEffects i guess*
![Avatar](https://cdn.discordapp.com/avatars/194128415954173952/708a8637ada505b6b7a85972807d9dca.webp?size=256)
Alfonsus Ardani
Yep
Yeah
Id u want cc to be ssrd it has to have initial state usestate
Basically the initial JSX must be present and populated with data already
![Avatar](https://cdn.discordapp.com/avatars/99023314038583296/2d36eda577fea6a5faf89948e592f23c.webp?size=256)
DollarNavalexOP
Hmm okay, does my states can be empty objects ?
Or it will make them render client-side ?
![Avatar](https://cdn.discordapp.com/avatars/194128415954173952/708a8637ada505b6b7a85972807d9dca.webp?size=256)
Alfonsus Ardani
If its empty objects then you wont get any initial data :/
Fetch the data on the server and pass it down to client components
![Avatar](https://cdn.discordapp.com/avatars/99023314038583296/2d36eda577fea6a5faf89948e592f23c.webp?size=256)
DollarNavalexOP
Hmm okay i see
And i have a last question then: until now, i was using Zustand to store my API data and be able to access it anywhere in my app. But with server-side fetching, I can't put this data in zustand, or i can but by passing it to a cc. Is there any way to make a server-side store, that can be updated on the fly ?
![Avatar](https://cdn.discordapp.com/avatars/99023314038583296/2d36eda577fea6a5faf89948e592f23c.webp?size=256)
DollarNavalexOP
Maybe i can just use the fetch api with a little lifetime cache (some seconds) and stop persisting data's ?
![Avatar](https://cdn.discordapp.com/avatars/99023314038583296/2d36eda577fea6a5faf89948e592f23c.webp?size=256)
DollarNavalexOP
Nvm, i made another post for this topic, thanks for your help here 😉