MCPcopy Create free account
hub / github.com/TanStack/devtools / createSolidPanel

Function createSolidPanel

packages/devtools-utils/src/solid/panel.tsx:9–32  ·  view source on GitHub ↗
(
  CoreClass: ClassType,
)

Source from the content-addressed store, hash-verified

7export interface DevtoolsPanelProps extends TanStackDevtoolsPluginProps {}
8
9export function createSolidPanel<TComponentProps extends DevtoolsPanelProps>(
10 CoreClass: ClassType,
11) {
12 function Panel(props: TComponentProps) {
13 let devToolRef: HTMLDivElement | undefined
14 const devtools = new CoreClass()
15 onSettled(() => {
16 if (devToolRef) {
17 devtools.mount(devToolRef, props)
18 }
19 return () => devtools.unmount()
20 })
21
22 return <div style={{ height: '100%' }} ref={devToolRef} />
23 }
24
25 function NoOpPanel(_props: TComponentProps) {
26 return <></>
27 }
28
29 return [Panel, NoOpPanel] as const
30}

Callers 2

A11yDevtools.tsFile · 0.90
A11yDevtools.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected