TanStackT
TanStackโ€ข2y agoโ€ข
1 reply
improved-purple

Issue with Real-time Table Data not Rendering

Hello there, I'd love to know if there are any references or examples for React with live or real-time table data. I'm bumping into some surprising behavior where I have a setup like so:

const data = useData() // updating once a second
const table = useReactTable({ data })
const { virtualItems } = useTableVirtualizer({ table })

<div>
{virtualItems.map(virtualRow => {
const row = table.getRowModel().rows[virtualRow.index]
return <div>
{row.getVisibleCells().map(cell => (
<div>{flexRender(cell.getContext())}</div>
))}
</div>
})}
</div>


Even though data is changing once a second, and logs confirm those changes, none of the updates are reflecting in the table view. If I force a re-render in the parent then the most recent data appears. If there are any pointers for live data that would be much appreciated!

Thank you ๐Ÿ™
Was this page helpful?