-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[DataGrid] Avoid re-rendering all cells on column change #12980
[DataGrid] Avoid re-rendering all cells on column change #12980
Conversation
Deploy preview: https://deploy-preview-12980--material-ui-x.netlify.app/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one 👌
I don't understand though why it was being mutated previously, is this something that was previously required for some reason (maybe in the non-sticky headers)? 🤔
packages/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts
Outdated
Show resolved
Hide resolved
packages/x-data-grid/src/components/columnHeaders/GridGenericColumnHeaderItem.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test for this use case?
packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderItem.tsx
Outdated
Show resolved
Hide resolved
52b949c
to
3d49cb9
Compare
Closes #12952
This change prevents all columns from re-rendering when one column is changed.
Before: https://codesandbox.io/p/sandbox/friendly-montalcini-yfkfvd
After: https://codesandbox.io/p/sandbox/black-brook-jr7r3d?file=%2Fsrc%2FApp.tsx