({
children,
container,
}: {
children: JSX.Element
container: HTMLElement
})
| 118 | |
| 119 | // Hands the portal's context to the separate root, so plugins can read the app's providers. |
| 120 | function 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. |
| 129 | function Portal( |
| 130 | { |
| 131 | children, |
| 132 | container, |
| 133 | }: { |
| 134 | children: JSX.Element |
| 135 | container: HTMLElement |
| 136 | }, |
| 137 | context: object, |
| 138 | ) { |
nothing calls this directly
no outgoing calls
no test coverage detected