Skip to content
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] Can't perform a React state update on a component that hasn't mounted yet. #17077

Open
mtr1990 opened this issue Mar 21, 2025 · 4 comments
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!

Comments

@mtr1990
Copy link

mtr1990 commented Mar 21, 2025

Steps to reproduce

Open this link to live example:
https://stackblitz.com/edit/github-wpmjdujl?file=src%2Fcomponents%2FProTip.tsx

Current behavior

In next.js 15 + react 19 + "@mui/x-data-grid": "^7.28.1"

Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.

Expected behavior

No error warning displayed

Context

No response

Your environment

No response

Search keywords: Can't perform a React state update on a component that hasn't mounted yet

@mtr1990 mtr1990 added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 21, 2025
@github-actions github-actions bot changed the title [Datagrid] Can't perform a React state update on a component that hasn't mounted yet. [data grid] Can't perform a React state update on a component that hasn't mounted yet. Mar 21, 2025
@github-actions github-actions bot added the component: data grid This is the name of the generic UI component, not the React module! label Mar 21, 2025
@michelengelen
Copy link
Member

I am not able to reproduce this. Could you elaborate on how to get this error to show?

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 21, 2025
@mtr1990
Copy link
Author

mtr1990 commented Mar 21, 2025

Hi please check:

Image Image

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Mar 21, 2025
@arminmeh
Copy link
Contributor

I see that the error disappears if colorSchemes are commented out from the theme.
@siriwatknp could this be related to the theme changes in mui/material-ui#45386?

@arminmeh arminmeh removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 21, 2025
@siriwatknp
Copy link
Member

I see that the error disappears if colorSchemes are commented out from the theme. @siriwatknp could this be related to the theme changes in mui/material-ui#45386?

That PR only effect the docs. I suspect that it comes from the useGridVirtualScroller.js based on the stack trace.

Image

Is there a way to disable virtualization to see if the issue goes away?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

4 participants