Skip to content
Source
Sign inSign up
TanStack/query

perf(devtools): Memoize Devtools QueryRow #4416

Mergedprateek3255(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/4416/headmerged by TkDodo View on GitHub

Showing 1 changed file with 78 additions and 76 deletions.

x
0 of 1 viewed, 1 left
78 additions and 76 deletionspackages/react-query-devtools/src/devtools.tsxModified
View file
@@ -1081,103 +1081,105 @@
queryCache: QueryCache
-const QueryRow = ({
- queryKey,
- setActiveQueryHash,
- activeQueryHash,
- queryCache,
-}: QueryRowProps) => {
- const queryHash =
- useSubscribeToQueryCache(
- queryCache,
- () => queryCache.find(queryKey)?.queryHash,
- ) ?? ''
-​
- const queryState = useSubscribeToQueryCache(
+const QueryRow = React.memo(
+ ({
+ queryKey,
+ setActiveQueryHash,
+ activeQueryHash,
queryCache,
- () => queryCache.find(queryKey)?.state,
- )
+ }: QueryRowProps) => {