T
TanStack17mo ago
eastern-cyan

Table gets stuck when adding new data from API on scroll.

This only happens when i use any styled component or a custom component to render in a cell. The page gets freezed and unusable when the data is being updated. When i dont have any custom component things work fine. Can anyone help?
10 Replies
eastern-cyan
eastern-cyanOP17mo ago
@Tanner Linsley ?
other-emerald
other-emerald17mo ago
You'll need to provide a sandbox of the issue for any further help.
eastern-cyan
eastern-cyanOP17mo ago
There's a lot of code. Can anyone come with me on call and help?
ambitious-aqua
ambitious-aqua17mo ago
You almost surely are just failing to give your columns or data a stable reference
ambitious-aqua
ambitious-aqua17mo ago
FAQ | TanStack Table Docs
How do I stop infinite rendering loops? If you are using React, there is a very common pitfall that can cause infinite rendering. If you fail to give your columns, data, or state a stable reference, React will enter an infinite loop of re-rendering upon any change to the table state.
eastern-cyan
eastern-cyanOP16mo ago
No, that is handled correctly
eastern-cyan
eastern-cyanOP16mo ago
I have noticed one thing that whenever i pass a custom or styled component in the cell, the whole table behaves weird and has jerky experience. If i use only info.getValue(), everything works fine
No description
eastern-cyan
eastern-cyanOP16mo ago
Seems like tanstack only works without UI, with some basic styles for cells its not possible to render it properly Tanstack is the worst table which i have ever used, overhyped for no reason
ambitious-aqua
ambitious-aqua16mo ago
you haven't shared relevant code yet (how the useReactTable hook is called with data and columns), but it is showing all of the symptoms of either columns or data not having a stable reference
eastern-cyan
eastern-cyanOP16mo ago
I will share it, but things work fine smoothly without styles, and same data structure works properly in any other table Do you mind coming in a call with me to help me debug? I will be ok if i get any other repo which has tanstack+inline components which some styles So that i can compare it and find the issue

Did you find this page helpful?