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

XGrid is re rendering every second or so #1558

Closed
peppermint-juli opened this issue May 3, 2021 · 5 comments
Closed

XGrid is re rendering every second or so #1558

peppermint-juli opened this issue May 3, 2021 · 5 comments
Labels
performance status: waiting for author Issue with insufficient information

Comments

@peppermint-juli
Copy link

peppermint-juli commented May 3, 2021

Hey everyone!
My eng team and I are trying to manage the app state on visibility change, meaning when a column is hidden or shown we need to call a method that saves this state. First of all there isn't even a native method to the XGrid that allows developers to manage this, so this might be a separate issue in the near future, but for now we found a way around it and tried using onStateChange that has a params object that we could use to track it but this method gets fired every second or so, which affects performance and memory. So all this to ask, why is XGrid re rendering every second or so? How can we prevent this? The hidden columns get shown again (meaning the grid state lost) out of the blue, because XGrid decides to re render out of nowhere.

Here's a Code SandBox link. I basically altered the code from the XGrid demo with the onStateChange and the browser window freezes and I have to close it.
https://codesandbox.io/s/material-demo-forked-sb1h1?file=/demo.tsx

Thanks in advance!

Order ID 💳

18479

@eps1lon eps1lon transferred this issue from mui/material-ui May 3, 2021
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 3, 2021
@dtassone
Copy link
Member

dtassone commented May 5, 2021

closing as its related to #1560

@oliviertassinari
Copy link
Member

XGrid is re rendering every second or so

@peppermint-juli The codesandbox you have provided doesn't demonstrate this. It's invalid.

@oliviertassinari oliviertassinari 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 May 5, 2021
@peppermint-juli
Copy link
Author

peppermint-juli commented May 5, 2021

You probably didn't even see the console. It logs almost 20 times for each action you take with the XGrid. Scroll, open vertical menus, virtually anything. That makes it really hard to use this method.

@oliviertassinari
Copy link
Member

oliviertassinari commented May 5, 2021

@peppermint-juli Ok, then it looks like a duplicate of #569. The framing of the issue made it sounds like the problem was that there is a set interval that makes the grid rerender every 1,000ms ("this method gets fired every second or so").
This is different to having multiple consecutive calls for each action.

@peppermint-juli
Copy link
Author

Yeah! Definitely looks like #569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

3 participants