preact-signals
preact-signals copied to clipboard
setQueryData is not a function
I can't apply a change to a useInfiniteQuery$
https://tanstack.com/query/latest/docs/framework/react/guides/infinite-queries#manually-removing-a-single-value-from-an-individual-page
const queryClient = useQueryClient$();
const newPagesArray =
oldPagesArray?.pages.map((page) =>
page.filter((val) => val.id !== updatedId),
) ?? []
queryClient.setQueryData(['projects'], (data) => ({
pages: newPagesArray,
pageParams: data.pageParams,
}))
setQueryData is not a function
and if I use
const queryClient = useQueryClient();
const newPagesArray =
oldPagesArray?.pages.map((page) =>
page.filter((val) => val.id !== updatedId),
) ?? []
queryClient.setQueryData(['projects'], (data) => ({
pages: newPagesArray,
pageParams: data.pageParams,
}))
I don't have any errors but it doesn't update
I don't know how you use it to delete in a useInfiniteQuery$?