@tanstack/react-query-devtools 4.3.8 → 4.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-query-devtools",
3
- "version": "4.3.8",
3
+ "version": "4.4.0",
4
4
  "description": "TODO",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -51,6 +51,6 @@
51
51
  "peerDependencies": {
52
52
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
53
53
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
54
- "@tanstack/react-query": "4.3.8"
54
+ "@tanstack/react-query": "4.4.0"
55
55
  }
56
56
  }
@@ -2,7 +2,8 @@ import * as React from 'react'
2
2
  import { fireEvent, screen, waitFor, act } from '@testing-library/react'
3
3
  import { ErrorBoundary } from 'react-error-boundary'
4
4
  import '@testing-library/jest-dom'
5
- import { useQuery, QueryClient } from '@tanstack/react-query'
5
+ import type { QueryClient } from '@tanstack/react-query'
6
+ import { useQuery } from '@tanstack/react-query'
6
7
  import { sortFns } from '../utils'
7
8
  import {
8
9
  getByTextContent,
@@ -1,4 +1,4 @@
1
- import { MatcherFunction } from '@testing-library/dom/types/matches'
1
+ import type { MatcherFunction } from '@testing-library/dom/types/matches'
2
2
  import { render } from '@testing-library/react'
3
3
  import * as React from 'react'
4
4
  import { ReactQueryDevtools } from '../devtools'
package/src/devtools.tsx CHANGED
@@ -1,14 +1,16 @@
1
1
  import * as React from 'react'
2
2
  import { useSyncExternalStore } from './useSyncExternalStore'
3
- import {
4
- useQueryClient,
5
- onlineManager,
6
- notifyManager,
3
+ import type {
7
4
  QueryCache,
8
5
  QueryClient,
9
6
  QueryKey as QueryKeyType,
10
7
  ContextOptions,
11
8
  } from '@tanstack/react-query'
9
+ import {
10
+ useQueryClient,
11
+ onlineManager,
12
+ notifyManager,
13
+ } from '@tanstack/react-query'
12
14
  import { rankItem, compareItems } from '@tanstack/match-sorter-utils'
13
15
  import useLocalStorage from './useLocalStorage'
14
16
  import { sortFns, useIsMounted } from './utils'
@@ -192,12 +194,13 @@ export function ReactQueryDevtools({
192
194
 
193
195
  React.useEffect(() => {
194
196
  if (isResolvedOpen) {
195
- const previousValue = rootRef.current?.parentElement?.style.paddingBottom
197
+ const root = rootRef.current
198
+ const previousValue = root?.parentElement?.style.paddingBottom
196
199
 
197
200
  const run = () => {
198
201
  const containerHeight = panelRef.current?.getBoundingClientRect().height
199
- if (rootRef.current?.parentElement) {
200
- rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`
202
+ if (root?.parentElement) {
203
+ root.parentElement.style.paddingBottom = `${containerHeight}px`
201
204
  }
202
205
  }
203
206
 
@@ -208,11 +211,8 @@ export function ReactQueryDevtools({
208
211
 
209
212
  return () => {
210
213
  window.removeEventListener('resize', run)
211
- if (
212
- rootRef.current?.parentElement &&
213
- typeof previousValue === 'string'
214
- ) {
215
- rootRef.current.parentElement.style.paddingBottom = previousValue
214
+ if (root?.parentElement && typeof previousValue === 'string') {
215
+ root.parentElement.style.paddingBottom = previousValue
216
216
  }
217
217
  }
218
218
  }
package/src/utils.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react'
2
2
  import type { Query } from '@tanstack/react-query'
3
3
 
4
- import { Theme, useTheme } from './theme'
4
+ import type { Theme } from './theme'
5
+ import { useTheme } from './theme'
5
6
  import useMediaQuery from './useMediaQuery'
6
7
 
7
8
  type StyledComponent<T> = T extends 'button'