Skip to content

Commit 86df0d2

Browse files
committed
fix(devtools): use Accessor types and fix QueryStatus context access
- Fix DevtoolsPanelState interface: use Accessor<T> instead of Signal<T> for read-side properties (SolidJS signals are [Accessor, Setter] tuples) - Add useDevtoolsPanelState() call to QueryStatus component which was referencing the old module-level selectedQueryHash and panelWidth signals that were removed in the isolation fix
1 parent b604fc2 commit 86df0d2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

packages/query-devtools/src/Devtools.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ import type {
8080
QueryCacheNotifyEvent,
8181
} from '@tanstack/query-core'
8282
import type { StorageObject, StorageSetter } from '@solid-primitives/storage'
83-
import type { Accessor, Component, JSX, Setter, Signal } from 'solid-js'
83+
import type { Accessor, Component, JSX, Setter } from 'solid-js'
8484

8585
interface DevtoolsPanelProps {
8686
localStore: StorageObject<string>
@@ -106,13 +106,13 @@ interface QueryStatusProps {
106106
* on the same page (e.g. micro-frontends with separate QueryClients).
107107
*/
108108
interface DevtoolsPanelState {
109-
selectedQueryHash: Signal<string | null>
109+
selectedQueryHash: Accessor<string | null>
110110
setSelectedQueryHash: Setter<string | null>
111-
selectedMutationId: Signal<number | null>
111+
selectedMutationId: Accessor<number | null>
112112
setSelectedMutationId: Setter<number | null>
113-
panelWidth: Signal<number>
113+
panelWidth: Accessor<number>
114114
setPanelWidth: Setter<number>
115-
offline: Signal<boolean>
115+
offline: Accessor<boolean>
116116
setOffline: Setter<boolean>
117117
}
118118

@@ -1788,6 +1788,7 @@ const QueryStatus: Component<QueryStatusProps> = (props) => {
17881788
const styles = createMemo(() => {
17891789
return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
17901790
})
1791+
const { selectedQueryHash, panelWidth } = useDevtoolsPanelState()
17911792

17921793
const { colors, alpha } = tokens
17931794
const t = (light: string, dark: string) => (theme() === 'dark' ? dark : light)

0 commit comments

Comments
 (0)