@tanstack/react-query 5.24.2 → 5.24.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-query",
3
- "version": "5.24.2",
3
+ "version": "5.24.5",
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.24.2"
44
+ "@tanstack/query-core": "5.24.5"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/react": "^18.2.55",
@@ -108,6 +108,16 @@ describe('queryOptions', () => {
108
108
  const data = queryClient.getQueryData(queryKey)
109
109
  expectTypeOf(data).toEqualTypeOf<number | undefined>()
110
110
  })
111
+ it('should return the proper type when passed to getQueryState', () => {
112
+ const { queryKey } = queryOptions({
113
+ queryKey: ['key'],
114
+ queryFn: () => Promise.resolve(5),
115
+ })
116
+
117
+ const queryClient = new QueryClient()
118
+ const state = queryClient.getQueryState(queryKey)
119
+ expectTypeOf(state?.data).toEqualTypeOf<number | undefined>()
120
+ })
111
121
  it('should properly type updaterFn when passed to setQueryData', () => {
112
122
  const { queryKey } = queryOptions({
113
123
  queryKey: ['key'],