TanStackT
TanStack2y ago
14 replies
liable-pink

Updating table data

I am having a problem with updating data to table, it doesn't get reflected/rendered correctly.
I am fetching data from my server, then I get data, I put it inside useReactTable hook - all good.
Next thing I've done is creating a handleScroll function to run whenever I scroll the table, when i get to the bottom, I send request to my server, which brings me items of page number 2, which then I update state of data thus I am expecting useReactTable hook to run again and give me the old+new items, however this isn't happening.
I can see in my own state that I do have the correct items and updated object but when i do:
table.getRowModel().rows.
I am getting only the old state.
Anyone familiar with this issue? maybe I am misusing the table? what approach can I have?
I cannot send all items at once since that api call will be very long so I broke it down.
Was this page helpful?