@tanstack/react-query 5.27.1 → 5.27.2

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.27.1",
3
+ "version": "5.27.2",
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.27.1"
44
+ "@tanstack/query-core": "5.27.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/react": "^18.2.55",
@@ -2435,28 +2435,23 @@ describe('useQuery', () => {
2435
2435
  rendered.getByText('Second Status: success')
2436
2436
  })
2437
2437
 
2438
- it('should not override query configuration on render', async () => {
2438
+ it('should update query options', async () => {
2439
2439
  const key = queryKey()
2440
2440
 
2441
- const queryFn1 = async () => {
2441
+ const queryFn = async () => {
2442
2442
  await sleep(10)
2443
2443
  return 'data1'
2444
2444
  }
2445
2445
 
2446
- const queryFn2 = async () => {
2447
- await sleep(10)
2448
- return 'data2'
2449
- }
2450
-
2451
2446
  function Page() {
2452
- useQuery({ queryKey: key, queryFn: queryFn1 })
2453
- useQuery({ queryKey: key, queryFn: queryFn2 })
2447
+ useQuery({ queryKey: key, queryFn, retryDelay: 10 })
2448
+ useQuery({ queryKey: key, queryFn, retryDelay: 20 })
2454
2449
  return null
2455
2450
  }
2456
2451
 
2457
2452
  renderWithClient(queryClient, <Page />)
2458
2453
 
2459
- expect(queryCache.find({ queryKey: key })!.options.queryFn).toBe(queryFn1)
2454
+ expect(queryCache.find({ queryKey: key })!.options.retryDelay).toBe(20)
2460
2455
  })
2461
2456
 
2462
2457
  it('should batch re-renders', async () => {
@@ -3685,10 +3680,10 @@ describe('useQuery', () => {
3685
3680
  it('should reset failureCount on successful fetch', async () => {
3686
3681
  const key = queryKey()
3687
3682
 
3688
- function Page() {
3689
- let counter = 0
3683
+ let counter = 0
3690
3684
 
3691
- const query = useQuery<string, Error>({
3685
+ function Page() {
3686
+ const query = useQuery({
3692
3687
  queryKey: key,
3693
3688
  queryFn: async () => {
3694
3689
  if (counter < 2) {