11/** @jsxImportSource preact */
22
33import { useEffect , useRef } from 'preact/hooks'
4+ import type { TanStackDevtoolsPluginProps } from '@tanstack/devtools'
5+
6+ export interface DevtoolsPanelProps extends TanStackDevtoolsPluginProps {
47
5- export interface DevtoolsPanelProps {
6- theme ?: 'light' | 'dark'
78}
89
910/**
@@ -24,9 +25,9 @@ export interface DevtoolsPanelProps {
2425 * ```
2526 */
2627export function createPreactPanel <
27- TComponentProps extends DevtoolsPanelProps | undefined ,
28+ TComponentProps extends DevtoolsPanelProps ,
2829 TCoreDevtoolsClass extends {
29- mount : ( el : HTMLElement , theme : 'light' | 'dark' ) => void
30+ mount : ( el : HTMLElement , props : TanStackDevtoolsPluginProps ) => void
3031 unmount : ( ) => void
3132 } ,
3233> ( CoreClass : new ( ) => TCoreDevtoolsClass ) {
@@ -38,7 +39,7 @@ export function createPreactPanel<
3839 devtools . current = new CoreClass ( )
3940
4041 if ( devToolRef . current ) {
41- devtools . current . mount ( devToolRef . current , props ?. theme ?? 'dark' )
42+ devtools . current . mount ( devToolRef . current , props )
4243 }
4344
4445 return ( ) => {
@@ -47,7 +48,7 @@ export function createPreactPanel<
4748 devtools . current = null
4849 }
4950 }
50- } , [ props ?. theme ] )
51+ } , [ props ] )
5152
5253 return < div style = { { height : '100%' } } ref = { devToolRef } />
5354 }
0 commit comments