-
-
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
[DataGridPro] onSortModelChange firing multiple times and also while table initially renders #2635
Comments
I agree with trickreich, this is a blocker. |
@trickreich can you provide an example that causes the inifinite loop ? |
I've built something similiar to our project: https://codesandbox.io/s/mui-x-data-grid-onsortmodelchange-infinite-loop-t72pm |
#2724 fixes the problem describes in the first message. It does not call I don't know if it will also fix your bug, I'll wait for the publication of the package on Codesandbox to check 👍 |
https://codesandbox.io/s/mui-x-data-grid-onsortmodelchange-infinite-loop-forked-20qrb @trickreich #2724 does seems to fix your bug Your component renders with new columns => The Grid updates the I added a check to avoid updating the But you should also memoize the column to avoid issues. |
Pretty nice, thanks for the quick response and help. |
@flaviendelangle any update on when #2724 will be merged? Thanks |
I will be in the next release |
@flaviendelangle can we please have this in v4.0.2 ASAP? |
@elyesbenabdelkader You can use MUI X v5 while the application stays on MUI Core v4. Here's the instructions. I don't know when there will be a v4.0.2 release as the effort is now on v5. |
@elyesbenabdelkader in order to temporary fix the problem I'm considering using the following approach:
@m4theushw I know that this is far to be optimal, but it seems to work. What do you think? Many thanks. Mauro N. |
It should work fine if you don't want to have v4 and v5 MUI core in your bundle. |
@flaviendelangle do you have an estimate as to when v5 will be released? Also, this issue mentions that we can't use v5 mui-x with v4 mui core? Is this correct? Is there a way we can have this specific fix patched as a minor fix to the v4 mui-x bundle? It's a breaking change to the v4 data-grid/pro functionality. |
@karanaditya993 You can use MUI X v5 and configure MUI Core v4 to not conflict with v5. See these instructions. |
Duplicates
Latest version
Current behavior 😯
Expected behavior 🤔
No response
Steps to reproduce 🕹
Source https://codesandbox.io/s/material-demo-forked-t5tq0?file=/demo.js
Steps:
Context 🔦
Due to multiple onSortModelChange event firing app is re-rendering eventually causing performance issues.
Your environment 🌎
`npx @mui/envinfo`
Order ID 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: