@tanstack/react-query 5.51.23 → 5.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/__tests__/useInfiniteQuery.test.tsx +1 -1
- package/src/__tests__/useQueries.test-d.tsx +1 -1
- package/src/__tests__/useQueries.test.tsx +2 -1
- package/src/__tests__/useQuery.test-d.tsx +1 -1
- package/src/__tests__/useQuery.test.tsx +2 -2
- package/src/__tests__/useSuspenseQueries.test-d.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-query",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.52.0",
|
|
4
4
|
"description": "Hooks for managing, caching and syncing asynchronous and remote data in React",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"!build/codemods/**/__tests__"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@tanstack/query-core": "5.
|
|
44
|
+
"@tanstack/query-core": "5.52.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/react": "npm:types-react@rc",
|
|
@@ -992,7 +992,7 @@ describe('useInfiniteQuery', () => {
|
|
|
992
992
|
expect(abortListeners[callIndex]).not.toHaveBeenCalled()
|
|
993
993
|
})
|
|
994
994
|
|
|
995
|
-
it('should not cancel an ongoing fetchNextPage request when another fetchNextPage is invoked if `cancelRefetch: false` is used
|
|
995
|
+
it('should not cancel an ongoing fetchNextPage request when another fetchNextPage is invoked if `cancelRefetch: false` is used', async () => {
|
|
996
996
|
const key = queryKey()
|
|
997
997
|
const start = 10
|
|
998
998
|
const onAborts: Array<Mock<(...args: Array<any>) => any>> = []
|
|
@@ -60,7 +60,7 @@ describe('UseQueries config object overload', () => {
|
|
|
60
60
|
expectTypeOf(data).toEqualTypeOf<{ wow: boolean }>()
|
|
61
61
|
})
|
|
62
62
|
|
|
63
|
-
it('
|
|
63
|
+
it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into useQuery', () => {
|
|
64
64
|
const query1 = queryOptions({
|
|
65
65
|
queryKey: ['key'],
|
|
66
66
|
queryFn: () => Promise.resolve(1),
|
|
@@ -358,7 +358,7 @@ describe('useQueries', () => {
|
|
|
358
358
|
}
|
|
359
359
|
})
|
|
360
360
|
|
|
361
|
-
it('correctly returns types when passing through queryOptions
|
|
361
|
+
it('correctly returns types when passing through queryOptions', () => {
|
|
362
362
|
// @ts-expect-error (Page component is not rendered)
|
|
363
363
|
function Page() {
|
|
364
364
|
// data and results types are correct when using queryOptions
|
|
@@ -713,6 +713,7 @@ describe('useQueries', () => {
|
|
|
713
713
|
queryFn:
|
|
714
714
|
fn && fn !== skipToken
|
|
715
715
|
? (ctx: QueryFunctionContext<TQueryKey>) => {
|
|
716
|
+
// eslint-disable-next-line vitest/valid-expect
|
|
716
717
|
expectTypeOf<TQueryKey>(ctx.queryKey)
|
|
717
718
|
return fn.call({}, ctx)
|
|
718
719
|
}
|
|
@@ -33,7 +33,7 @@ describe('initialData', () => {
|
|
|
33
33
|
expectTypeOf(data).toEqualTypeOf<{ wow: boolean }>()
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
it('
|
|
36
|
+
it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into useQuery', () => {
|
|
37
37
|
const options = queryOptions({
|
|
38
38
|
queryKey: ['key'],
|
|
39
39
|
queryFn: () => Promise.resolve(1),
|
|
@@ -3959,7 +3959,7 @@ describe('useQuery', () => {
|
|
|
3959
3959
|
expect(results[2]).toMatchObject({ data: 'fetched data', isStale: false })
|
|
3960
3960
|
})
|
|
3961
3961
|
|
|
3962
|
-
it('
|
|
3962
|
+
it('should support enabled:false in query object syntax', async () => {
|
|
3963
3963
|
const key = queryKey()
|
|
3964
3964
|
const queryFn = vi.fn<(...args: Array<unknown>) => string>()
|
|
3965
3965
|
queryFn.mockImplementation(() => 'data')
|
|
@@ -5911,7 +5911,7 @@ describe('useQuery', () => {
|
|
|
5911
5911
|
})
|
|
5912
5912
|
})
|
|
5913
5913
|
|
|
5914
|
-
it('
|
|
5914
|
+
it('should have status=error on mount when a query has failed', async () => {
|
|
5915
5915
|
const key = queryKey()
|
|
5916
5916
|
const states: Array<UseQueryResult<unknown>> = []
|
|
5917
5917
|
const error = new Error('oops')
|
|
@@ -48,7 +48,7 @@ describe('UseSuspenseQueries config object overload', () => {
|
|
|
48
48
|
expectTypeOf(data).toEqualTypeOf<{ wow: boolean }>()
|
|
49
49
|
})
|
|
50
50
|
|
|
51
|
-
it('
|
|
51
|
+
it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into useQuery', () => {
|
|
52
52
|
const query1 = queryOptions({
|
|
53
53
|
queryKey: ['key'],
|
|
54
54
|
queryFn: () => Promise.resolve(1),
|