-
-
Notifications
You must be signed in to change notification settings - Fork 36
Devtools Panel always requires props #82
Description
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.
| import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/solid' | |
| import type { JSX } from 'solid-js' | |
| export interface HotkeysDevtoolsSolidInit extends DevtoolsPanelProps {} | |
| type HotkeysDevtoolsPanelComponent = ( | |
| props: HotkeysDevtoolsSolidInit, | |
| ) => JSX.Element |
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.