Svelte 5 and TanStack Query, how to react to fetched data change #5745
-
Hi, I have been trying (unsuccessfully) to use TanStack Query to fetch some data that has to be rendered in a TanStack table. I am following the example found in the alpha-10 version available, with the minimum needed changes to (ideally) work: let options: TableOptions<MyType> = {
data: $query.data ?? [],
columns: defaultColumns,
getCoreRowModel: getCoreRowModel()
};
const table = createTable(options); I have already checked that the query actually receives the data (it does), so then I'm wondering what should be changed to get the table to react to data changes. I've tried using also a From what I've seen, in the past the Does anybody have any suggestion? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
I think you have to use the get keyword in svelte? |
Beta Was this translation helpful? Give feedback.
https://github.com/TanStack/table/blob/alpha/examples/svelte/column-ordering/src/App.svelte
advice from @walker-tx