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

Function Portal

packages/preact-devtools/src/devtools.tsx:120–135  ·  view source on GitHub ↗
({
  children,
  container,
}: {
  children: JSX.Element
  container: HTMLElement
})

Source from the content-addressed store, hash-verified

118
119// Hands the portal's context to the separate root, so plugins can read the app's providers.
120function ContextProvider(
121 this: { getChildContext?: () => object },
122 props: { context: object; children: ComponentChildren },
123) {
124 this.getChildContext = () => props.context
125 return props.children
126}
127
128// Core `createPortal` only exists in Preact 11, and `preact/compat` patches global options.
129function Portal(
130 {
131 children,
132 container,
133 }: {
134 children: JSX.Element
135 container: HTMLElement
136 },
137 context: object,
138) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected