-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[data grid] Initial SSR render support #7599
Comments
Hi @plevamatus
In theory, it might be possible to make the data grid work with SSR when the virtualization is disabled. Have you encountered any specific performance issues? |
Hi @cherniavskii, |
@plevamatus Thanks for the update!
Did you render both grids on the same page? By initial render you mean the time from the page load to the first grid render with the data? |
One more request for SSR support: #6803 (comment) |
I explored this a bit and created a quick PoC in my fork: cherniavskii#5 |
SSR support sounds like a great opportunity to improve the UX for the first-page load on dashboards. The data grid is often the primary content on the page end-users open to read but all the JavaScript needs to load first to be able to access the data. This problem is getting worse with Next.js's popularity and React's team push toward the server. Now, end-users also need to wait for the hydration to complete. For the technical solution, I imagine that we could expose a new prop, e.g. It's not directly related, but we could connect this SSR issue, #7583, and #8179 with the RSC (React Server Components): https://twitter.com/devagrawal09/status/1636971320138162176. |
I am using metarial react table with nextjs14. I found a way that table run with ssr. I don't know it is best practice for nextjs or not? I am using that table with searchParams. //MaterialTable.tsx
manualPagination = true,
onPaginationChange: (updaterOrValue: any) => {
(() => {
const newPaginationValue = updaterOrValue(pagination);
setPagination(newPaginationValue);
const params = new URLSearchParams(searchParams.toString());
params.set('page', newPaginationValue.pageIndex + 1);
params.set('pageSize', newPaginationValue.pageSize);
router.push('?' + params);
})();
},`
//page.tsx
`await fetchData(USER_QUERY, {
take: Number(searchParams.pageSize),
skip: skip, |
I'm experiencing this as well. Having a dashboard that displays some cards with graphs, and a data grid. The cards are perfectly able to SSR, but the datagrid shows nothing until mounted. This causes a flicker in some parts of the dashboard. Even if parts of the grid require measurement, I believe it should be possible to render at least the border, toolbar, footer, column header (without individual columns). And as long as it's not mounted, the loading state could be displayed? |
Summary 💡
It seems that data grid is not rendered on server. I didn't find any information whether this feature is implemented or whether you plan to implement ssr support in the future.
Examples 🌈
No response
Motivation 🔦
SSR support could improve performance, especially when using large data sets
Order ID 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: