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] disable processor cleanups in development / testing #16400

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

lauri865
Copy link
Contributor

@lauri865 lauri865 commented Jan 30, 2025

Trying to fix a hairy issue discovered here:
#16395 (comment)

The problem is that useFirstRender doesn't work properly in StrictMode. It is only called once, but everything else is called twice, meaning that processors are improperly cleaned up. Trying to see if we can just disable cleanups in development to preserve the functionality of useFirstRender with StrictMode.

If useFirstRender doesn't work properly with StrictMode, and we cleanup processors incorrectly, we have a few problems:

  • processors might not silently work, because they are only registered in useEffect, so ordering of hooks is extremely important in useDatagridComponent hook
  • it might lead to writing unoptimised code that waits a few cycles until it works, that's only to make tests pass / StrictMode happy

@mui-bot
Copy link

mui-bot commented Jan 30, 2025

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

Generated by 🚫 dangerJS against a1e1c2a

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants