-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add React Server Component support for Layout components (Grid, Stack, Container) #35993
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
In case it helps lending some weight to my 👍, here's our order ID 💳: 61706 This feature, especially in conjunction with #34826 would be most welcome for an upcoming project. |
@bchilcott You may be mixing up Server Components with Server-side rendering? A The introduction of RSCs does not change anything about SSR – see this (illustrated!) explanation by Dan Abramov for a short but clear explanation: reactwg/server-components#4 |
Server components aren’t hydrated in the normal sense (or at all? correct me if I’m wrong?), and they don’t require the additional JavaScript which goes along with that. Why would Typography need to? By using |
Ultimately it's because of Emotion, all the Material UI components are styled with Emotion's Hence the effort to move to a zero-runtime styling solution! #34826 |
Agreed - my point was only that using
#34826 is certainly promising though. |
From the February 26th styled meeting: this is a "nice to have" for Material UI v6.0.0. Meaning if we have the time, it will happen in v6.0.0, if not later on. Our main assumptions:
https://www.flightcontrol.dev/blog/nextjs-app-router-migration-the-good-bad-and-ugly
https://twitter.com/olivtassinari/status/1755964491399848422
|
Summary 💡
Right now, Material UI, Joy UI, and all MUI's projects need to have 'use client'; in their header. None can't work as server-side components.
Wouldn't it be great if developers could use the layout components without sending a single line of JavaScript to the client? For example, a
<Stack>
should be able to be a React Server Component.To make it work with Material UI, Joy UI, and MUI System, we might need to fix #34826.
Out of scope
For other components, like the
<Button>
, it's unclear what would be best. There are cases where a CSS-only version could be good enough, but without "use client", developers will have to decide each time if they want it interactive client-side or not.For example mui/mui-x#12180
Base UI doesn't have any styles and is focused on the logic, so RSC for it doesn't make sense.
Examples 🌈
https://twitter.com/olivtassinari/status/1601579688979464192
Motivation 🔦
Improve performance for landing pages.
The text was updated successfully, but these errors were encountered: