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

Function Panel

packages/devtools-utils/src/react/panel.tsx:30–50  ·  view source on GitHub ↗
(props: TComponentProps)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

mountMethod · 0.45
unmountMethod · 0.45

Tested by

no test coverage detected