Skip to content

Commit 17ff372

Browse files
committed
fix: typings of setData in InfiniteQuery
1 parent 8b22913 commit 17ff372

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.changeset/major-humans-worry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"mobx-tanstack-query": patch
3+
---
4+
5+
fixed typings in `setData` of `InfiniteQuery`

src/inifinite-query.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,13 @@ export class InfiniteQuery<
515515
}
516516

517517
setData(
518-
updater: Updater<NoInfer<TData> | undefined, NoInfer<TData> | undefined>,
518+
updater: Updater<
519+
NoInfer<InfiniteData<TQueryFnData, TPageParam>> | undefined,
520+
NoInfer<InfiniteData<TQueryFnData, TPageParam>> | undefined
521+
>,
519522
options?: SetDataOptions,
520523
) {
521-
this.queryClient.setQueryData<TData>(
522-
this.options.queryKey,
523-
updater,
524-
options,
525-
);
524+
return Query.prototype.setData.call(this, updater, options);
526525
}
527526

528527
/**

0 commit comments

Comments
 (0)