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] Update grid dimensions inside handler instead of useEffect #13231

Closed
wants to merge 2 commits into from
Closed

[data grid] Update grid dimensions inside handler instead of useEffect #13231

wants to merge 2 commits into from

Conversation

layerok
Copy link
Contributor

@layerok layerok commented May 23, 2024

Fixes #13230

@layerok layerok changed the title update grid dimensions inside handler instead of useEffect [data grid] update grid dimensions inside handler instead of useEffect May 23, 2024
@mui-bot
Copy link

mui-bot commented May 23, 2024

Deploy preview: https://deploy-preview-13231--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 15c26c7

@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label May 24, 2024
@oliviertassinari oliviertassinari changed the title [data grid] update grid dimensions inside handler instead of useEffect [data grid] Update grid dimensions inside handler instead of useEffect May 24, 2024
@michelengelen michelengelen added bug 🐛 Something doesn't work feature: Rendering layout Related to the data grid Rendering engine labels May 24, 2024
@layerok
Copy link
Contributor Author

layerok commented May 24, 2024

I based my solution on an idea I read in the react documentation. The idea is that if useEffect doesn't clear its effects, then most likely useEffect is being used incorrectly. So I removed it and that fixed the issue, but then I saw failed tests and I realized that I hadn't taken into account that this useEffect is responsible for synchronizing the state with the props.

I will try to come up with a better solution.

@layerok
Copy link
Contributor Author

layerok commented May 26, 2024

This is not a MUI issue. It is a react-router issue.

@layerok layerok closed this May 26, 2024
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! feature: Rendering layout Related to the data grid Rendering engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] infinite loop occurs under certain circumstances
4 participants