can use only 2 args on useQuery()
Hi
I can’t use more than 2 arguments when invoking useQuery with options (keepPreviousData)
Error : no overload match this call
I'd like to specify that I prefetch on the server side with a cached QueryClient(), then I pass the client with dehydrate to my components (as on the doc).
8 Replies
rising-crimson•2y ago
On v5?
https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#supports-a-single-signature-one-object
https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#removed-keeppreviousdata-in-favor-of-placeholderdata-identity-function
Migrating to TanStack Query v5 | TanStack Query Docs
Breaking Changes
v5 is a major version, so there are some breaking changes to be aware of:
modern-tealOP•2y ago
Hi thanks for your response but even after wrap all on object the error still persist @troywoy
other-emerald•2y ago
Show a typescript playground reproduction
modern-tealOP•2y ago
@M00LTi https://stackblitz.com/edit/stackblitz-starters-pq8bcr?file=components%2Fquotes.tsx (on components/quotes.tsx)
other-emerald•2y ago
Can’t access it. And a typescript playground might be better
modern-tealOP•2y ago
my bad sorry now you can
@M00LTi thats the deal, im working with ssr
rising-crimson•2y ago
Did you notice I sent two links?
keepPreviousData
was removed.
modern-tealOP•2y ago
That is literally my fault sorry mate I’ve only check your first link, and thank you