T
TanStack2y ago
modern-teal

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
modern-teal
modern-tealOP2y ago
Hi thanks for your response but even after wrap all on object the error still persist @troywoy
other-emerald
other-emerald2y ago
Show a typescript playground reproduction
modern-teal
modern-tealOP2y ago
other-emerald
other-emerald2y ago
Can’t access it. And a typescript playground might be better
modern-teal
modern-tealOP2y ago
my bad sorry now you can @M00LTi thats the deal, im working with ssr
rising-crimson
rising-crimson2y ago
Did you notice I sent two links? keepPreviousData was removed.
import { useQuery, keepPreviousData } from "@tanstack/react-query";

useQuery({
...,
placeholderData: keepPreviousData
})
import { useQuery, keepPreviousData } from "@tanstack/react-query";

useQuery({
...,
placeholderData: keepPreviousData
})
modern-teal
modern-tealOP2y ago
That is literally my fault sorry mate I’ve only check your first link, and thank you

Did you find this page helpful?