is there an enabled flag on `useSuspenseQuery` in v5 beta?
how can I skip running a query
15 Replies
plain-purpleOP•3y ago
running into a lot of issues w/ @tanstack/react-query-next-experimental
plain-purpleOP•3y ago
here's providers

plain-purpleOP•3y ago
queries.ts

plain-purpleOP•3y ago
artists fetch

plain-purpleOP•3y ago

plain-purpleOP•3y ago
infinite loop of requests on the client - staleTime or anything doesn't seem to work
the code is open source and easily runnable if you want to take a look
continuing-cyan•3y ago
There is no enabled on useSuspenseQuery
Can you show a reproduction of that infinite loop?
plain-purpleOP•3y ago
Yeah I’m on my phone but it’s on GitHub
RelistenNet/relisten-web
Branch is app-dir
Should just be a yarn and then run. Don’t need any data or server
continuing-cyan•3y ago
also on mobile 😂 can take a look tomorrow
plain-purpleOP•3y ago
haha cool, happy to walk through it together
thank you!
continuing-cyan•3y ago
infinite loop of requests on the clientyou're likely missing a suspense boundary
plain-purpleOP•3y ago
so that fixed it but it doesn't block on initial render from the server

plain-purpleOP•3y ago
obv it loads the fallback state – is there a way to get it to just block?
is the only way to prefetch inside of an RSC and then pass that into the react query hydration?
also, how can I skip a suspense request?
just return early in the queryFn?
continuing-cyan•3y ago
Not render the component
sensitive-blue•3y ago
Im having the same issue with this infinite loop, when using
useSuspenseQuery. I wrapped my component (wich uses it) in <Suspense> in the parent component.