icflorescu/mantine-datatable

Infinite loop problem in table

Closed this issue · 11 comments

Describe the bug
In my table component, an infinite loop is happening when rendering the component.

I tried commenting out all the props I'm passing, lifecycle methods, etc., even the columns objects, but the problem persists.

When I commented out the DataTable, the loop stopped happening.

I also noticed that on the library's official website, a loop is happening in a similar way to what happens to me.

Have there been any bugs recently that are being resolved?

Screenshots
If applicable, add screenshots to help explain your problem.
Captura de tela 2024-06-19 150636

  • OS: Windows 11
  • Browser Chrome/Edge
  • Version [7.1.5]
  • Mantine Core Version [7.5.1]

Can confirm this is a bug in 7.10.3 and not in 7.10.2, just tested my app with both versions. Also happens in, for example, https://icflorescu.github.io/mantine-datatable/examples/overriding-the-default-styles

Tagging @icflorescu for visibility. Mantine DataTable is effectively unusable as of version 7.10.3. And the docs site is broken due to the same reason. Maybe revert changes after 7.10.2 and publish a new 7.10.4 version while trying to figure out what's broken? Thanks!

Same here. I can't access expanding-rows doc for example and quickly get extremely high CPU usage from the page.

Thank you all for reporting and apologies for being unable to properly address it in a timely manner due to a personal issue: my mother is still in the hospital following a stroke, I haven't slept properly for more than a week, and I simply don't have mental energy and resources at the moment... There's hope that the situation will improve soon.

I'll revert the PR that's causing this and publish 7.10.4 today.

@gfazioli, can you please have a look when you find a moment?... thanks!

@icflorescu, I’m deeply sorry to hear about your mom. My thoughts are with you and your family. And thanks a lot for taking the time for this. ♥️

Thanks for the kind words, @gabrielmaldi. 7.10.4 is now published.

Can confirm that 7.10.4 is working perfectly for me. Thanks!

@icflorescu Sorry to hear that, I'll keep her in my prayers 🙏🏼 Wishing her a speedy recovery and strength for your family. Thank you for your good work.

@icflorescu I'm sorry to hear about your situation. Please take care of yourself and your mother. I'm here for you if you need anything. Wishing for a speedy recovery for your mother.

@icflorescu I was able to fix the "edge" case - PR

The issue was due to the default key used to store the order, size, and toggling of the columns.
In particular, it involved the documentation where there are multiple DataTables on the same view.

The default value created an infinite loop when having multiple DataTables on the same view. This was because using the same key, the data was always read and written to the same storage. Now, if the key is undefined, no data is written, indicating that the resizing, sizing, or sorting functions on the columns are not being used.