-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Checkbox] Slows down the render of the page #36186
Comments
Material UI adds functionality on top of the native checkbox, so it's understandable it'll work slower. |
I understand that MUI comes with overhead, but the difference between a MUI checkbox and a basic checkbox is like comparing a scooter to a bullet train. |
I would be curious to see Pigment CSS's impact here but the reproduction is not available anymore. https://github.com/alexander-vashchuk/react-slow-render is a 404. In any case, it looks like a case where the rerendering of the React tree should be pruned. Meaning, that updating one checkbox should likely not trigger the rerender of 1,000 rows. |
For me it works as expected without any function associated to the onChange prop, but as soon as I set any function to it I get the described delay. And if I use the same function on a basic checkbox it works just fine. |
Steps to reproduce 馃暪
I have a long list of people (1000)
Each of them has a checkbox status attach to every user
I did notice when I use HTML checkbox instead of MUI one, the page renders about 3 to 5 times faster
The issue only occurs when I'm dealing with a long list of players, it does not affect a short list of players,
at least from the visible standpoint
Repository with live reproduction:
https://github.com/alexander-vashchuk/react-slow-render
Current behavior 馃槸
Checkbox takes a while to update the page
Expected behavior 馃
Checkbox works immediately
Context 馃敠
Demo:
![animation](https://user-images.githubusercontent.com/86713661/218817450-0e876a54-5af7-4b8c-a821-feaea1dbc08d.gif)
I would like any help on this one, I might be doing something stupid from the React optimization standpoint, so I'd appreciate any advice
Your environment 馃寧
The text was updated successfully, but these errors were encountered: