Hildebrandt Tobias
07/15/2025, 8:45 AMArray
through useQuery<Array<MyType>>()
and feed it into the TanStackTable directly everyting works, no problems.
But when I filter the Array
or convert it to a list for other reasons and then convert it back via .toTypedArray()
the TanStackTable displays the data correctly, but it refreshes infinitely and very fast lagging the tab.
I can see the constant getXXXModel()
log messages in the console.
previewDataQuery
.data
?.filter { it.active }
?.toTypedArray()
Someone got a suggestion how to fix this?
Edit: So the behaviour is essentially like this:
useReactTable(data = previewData) // OK
useReactTable(data = previewData.toList().toTypedArray()) // Infinite Loop
Hildebrandt Tobias
07/15/2025, 9:20 AMval previewData = useMemo(previewDataQuery.data) {
previewDataQuery.data
?.filter { it.active }
?.toTypedArray()
}