setInfiniteQueryData and getInfiniteQueryData compatibility
I want to
setInfiniteQueryData
to old data (before mutation). I have a following code:
But line:
is having error in vscode
:
Argument of type 'InfiniteData<{ items: { message: string; name: string; id: string; }[]; nextCursor: string | undefined; }> | undefined' is not assignable to parameter of type 'Updater<InfiniteData<{ items: { message: string; name: string; id: string; }[]; nextCursor: string | undefined; }> | undefined, InfiniteData<{ items: { message: string; name: string; id: string; }[]; nextCursor: string | undefined; }>>'. Type 'undefined' is not assignable to type 'Updater<InfiniteData<{ items: { message: string; name: string; id: string; }[]; nextCursor: string | undefined; }> | undefined, InfiniteData<{ items: { message: string; name: string; id: string; }[]; nextCursor: string | undefined; }>>'.ts(2345)
1 Reply
This would work for
setQueryData
and getQueryData