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

Function Panel

packages/devtools-utils/src/preact/panel.tsx:32–52  ·  view source on GitHub ↗
(props: TComponentProps)

Source from the content-addressed store, hash-verified

30 },
31>(CoreClass: new () => TCoreDevtoolsClass) {
32 function Panel(props: TComponentProps) {
33 const devToolRef = useRef<HTMLDivElement>(null)
34 const devtools = useRef<TCoreDevtoolsClass | null>(null)
35 useEffect(() => {
36 if (devtools.current) return
37 devtools.current = new CoreClass()
38
39 if (devToolRef.current) {
40 devtools.current.mount(devToolRef.current, props)
41 }
42
43 return () => {
44 if (devToolRef.current) {
45 devtools.current?.unmount()
46 devtools.current = null
47 }
48 }
49 }, [props])
50
51 return <div style={{ height: '100%' }} ref={devToolRef} />
52 }
53
54 function NoOpPanel(_props: TComponentProps) {
55 return <></>

Callers

nothing calls this directly

Calls 2

mountMethod · 0.45
unmountMethod · 0.45

Tested by

no test coverage detected