Skip to content

Commit 0547e62

Browse files
fix(devtools): Default ReactQueryDevtoolsPanel isOpen to true (TanStack#2746)
change the `isOpen` prop for the ReactQueryDevtoolsPanel component to default to true. The subscriptions aren't set up when no isOpen prop is passed, which makes the panel not show any updates when used without the isOpen prop. Closes TanStack#2745
1 parent a53f632 commit 0547e62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/devtools/devtools.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ interface DevtoolsPanelOptions {
7272
/**
7373
* A boolean variable indicating whether the panel is open or closed
7474
*/
75-
isOpen: boolean
75+
isOpen?: boolean
7676
/**
7777
* A function that toggles the open and close state of the panel
7878
*/
@@ -365,7 +365,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef<
365365
HTMLDivElement,
366366
DevtoolsPanelOptions
367367
>(function ReactQueryDevtoolsPanel(props, ref): React.ReactElement {
368-
const { isOpen, setIsOpen, handleDragStart, ...panelProps } = props
368+
const { isOpen = true, setIsOpen, handleDragStart, ...panelProps } = props
369369

370370
const queryClient = useQueryClient()
371371
const queryCache = queryClient.getQueryCache()

0 commit comments

Comments
 (0)