Devtools Panel always requires props #82
TanStack Hotkeys version#
0.7.0
Framework/Library version#
React v.19.2.3
Describe the bug and the steps to reproduce it#
I'm not sure if this is intentional or not, but currently the typing for the Hotkeys Devtools Panel (React, Preact, and Solid) requires that you pass in props. I just noticed this after doing an upgrade to the packages. These required props look to be ones required by TanStack Devtools.
Right now, this means that if you want to use the panel, then you are always required to pass in these props.
import { HotkeysDevtoolsPanel } from '@tanstack/react-hotkeys-devtools'
export function App() {
return <HotkeysDevtoolsPanel theme='dark' devtoolsOpen={false} />
}
This feels wrong.
Also, if I'm not mistaken, these props shouldn't be required since the initial state for the panel has fallback defaults, so perhaps this is something to be fixed upstream in TanStack Devtools or perhaps it has a specific implementation type for those creating their own Panels which isn't being used here.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)#
https://stackblitz.com/edit/github-tc8bes9w?file=src%2Findex.tsx
Screenshots or Videos (Optional)#
No response
Do you intend to try to help solve this bug with your own PR?#
None
Terms & Code of Conduct#
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
I think the devtools packages expects this syntax now?
@KevinVandy this is for when you want to render the Panel component without the TanStack Devtools dock.
My small suggestion is a bit more about consistency across TanStack packages. When similar devtools panel components exist in different packages, it would be great if their naming/API style could feel a bit more aligned.
Right now, when I work with other dev tools, it looks like this:
<TanStackDevtools config={{ defaultOpen: false }} plugins={[ { name: "Tanstack Query", render: <ReactQueryDevtoolsPanel /> }, { name: "Tanstack Router", render: <TanStackRouterDevtoolsPanel />, }, hotkeysDevtoolsPlugin(), ]} />Or I could use
<HotkeysDevtoolsPanel />, but have to pass props as mentioned above. Just a small DX suggestion. Thanks again for the great work.KevinVandy closed this
Sign in to join this conversation.
I think the devtools packages expects this syntax now?