You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Masonry component from @mui/lab package is not rendered correctly on the server side. Therefore when JavaScript is disabled on the client, it's not rendered.
Initially, it will render one column despite the value of the column prop. After hydration is done, it'll show the correct number of columns.
The main issue here is the layout shifting during the client-side rendering.
Expected behavior 🤔
When using the Masonry component from @mui/lab package, I expect it to be fully rendered on the server-side.
Steps to reproduce 🕹
Steps:
In a Next.js project, set up mui with emotion engine.
Install mui/lab package and import Masonry component.
Use the Masonry component and set the column prop to a fixed number (e.g. 3).
Build your project and run a production env.
Disable javascript in the browser.
You will see the Masonry component rendered with one column.
Context 🔦
I'm trying to implement a Masonry fully rendered on the server without any client-side rendering to avoid layout shifting.
danilo-leal
changed the title
@mui/lab Masonry Component is Not Rendered Correctly With SSR
[Masonry] Component is not rendered correctly with SSR
May 10, 2022
Duplicates
Latest version
Current behavior 😯
The Masonry component from @mui/lab package is not rendered correctly on the server side. Therefore when JavaScript is disabled on the client, it's not rendered.
Initially, it will render one column despite the value of the
column
prop. After hydration is done, it'll show the correct number of columns.The main issue here is the layout shifting during the client-side rendering.
Expected behavior 🤔
When using the Masonry component from @mui/lab package, I expect it to be fully rendered on the server-side.
Steps to reproduce 🕹
Steps:
Context 🔦
I'm trying to implement a Masonry fully rendered on the server without any client-side rendering to avoid layout shifting.
Your environment 🌎
My browser is Chrome 101.0.4951.54
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: