-
-
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] "Cannot read property 'id' of undefined" when rows updates #571
Comments
Do you have a reproduction we can look at? |
@oliviertassinari here is a Codesandbox link with a (somewhat) reproduction. Comment out the Let me know if you need more. Thanks! |
@BrentFarese Thanks for the reproduction. I don't think that it's the same problem. I'm renaming the issue. This is a simplified version of the bug: https://codesandbox.io/s/material-ui-data-grid-bug-forked-b9g0g?file=/src/App.tsx. Your reproduction works if you make the rows stable. The data grid doesn't use |
Thank you for looking into it @oliviertassinari. I can confim that extracting the row data out/making the rows stable does seem to work. But that doesn't seem viable in production as our row data is dynamic. I can also confirm that removing the I'm not sure if it's related to our issue. I think it might be. Both stack traces seem to lead to the I have tried to fiddle more with my reproduction to get it to reproduce the exact error we are seeing in the GIF/screenshots above, but it's difficult. I will post an update here if I can reproduce the exact error. Thanks! |
+1 for this issue, I am experiencing the same error when trying to re-render an |
The reproduction is fixed (https://codesandbox.io/s/material-ui-data-grid-bug-forked-b9g0g?file=/package.json) with #599. |
The fix was released in v4.0.0-alpha.10. |
In version 4.0.0-alpha.32 I still get the error after I update the rows property with a new set of rows where one row was removed. My scenario is:
I think it is quite typical scenario to want to be able to delete rows from the table or add new ones, so I'm wondering whether this is still an issue in XGrid or it might be just a wrong usage from my side. |
@vitalist82 If you have a minimal reproduction with the latest version, please open a new issue. You can find a codesandbox template in the new issue template. |
@oliviertassinari i opened a new issue #1958 with a codesandbox. |
Current Behavior 😯
We are utilizing the XGrid component. We have a responsive layout whereby we hide columns in the XGrid if the layout becomes too small. When we get to a breakpoint resizing the window and try to hide columns, XGrid breaks. See GIF below.
These are the errors we see in the console:
Expected Behavior 🤔
Resizing of the browser window and hiding columns as a result should work as expected without error.
Steps to Reproduce 🕹
Steps:
useMediaQuery
hook from MUI and thehide
prop of theColDef
to do this).I can confirm that removing the
hide
prop from ourColDef
s causes the error to go away.Context 🔦
Trying to make the XGrid responsive to layout changes in our app.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: