@tanstack/react-query 5.17.3 → 5.17.4

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.17.3",
3
+ "version": "5.17.4",
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.17.3"
44
+ "@tanstack/query-core": "5.17.4"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/react": "^18.2.45",
@@ -978,7 +978,7 @@ describe('useQueries', () => {
978
978
  )
979
979
  })
980
980
 
981
- it('should not return new instances when called without queries', async () => {
981
+ it.skip('should not return new instances when called without queries', async () => {
982
982
  const key = queryKey()
983
983
  const ids: Array<number> = []
984
984
  let resultChanged = 0
@@ -1027,6 +1027,28 @@ describe('useQueries', () => {
1027
1027
  expect(resultChanged).toBe(1)
1028
1028
  })
1029
1029
 
1030
+ it('should not have infinite render loops with empty queries (#6645)', async () => {
1031
+ let renderCount = 0
1032
+
1033
+ function Page() {
1034
+ const result = useQueries({
1035
+ queries: [],
1036
+ })
1037
+
1038
+ React.useEffect(() => {
1039
+ renderCount++
1040
+ })
1041
+
1042
+ return <div>data: {JSON.stringify(result)}</div>
1043
+ }
1044
+
1045
+ renderWithClient(queryClient, <Page />)
1046
+
1047
+ await sleep(10)
1048
+
1049
+ expect(renderCount).toBe(1)
1050
+ })
1051
+
1030
1052
  it('should only call combine with query results', async () => {
1031
1053
  const key1 = queryKey()
1032
1054
  const key2 = queryKey()