I need some help with a code
The problem I am getting is that, in the first code snippet, the reference to "id" only captures the initial state of id, if my id changes, it is not reactive. The solution would be wrapping the "useGetAllBetsBySheetId" on a "$derived(...)" rune, however, for TanStack Query, it does not work that way, it actually causes an infinite loop of requests (see here. What do I do in this situation in order to make my code work?
I am using SvelteKit 5 and the port to Svelte 5 for TanStack Query (not released yet).
0 Replies