WindowContextValue
Defined in: renderer/context.ts:12
Internal window context value.
State is intentionally omitted — consumers use useSyncExternalStore via subscribe/getSnapshot to opt in to re-renders only when they care about a specific piece of state. This prevents all portal children from re-rendering on every window state change.
Properties
Section titled “Properties”document
Section titled “document”document:
Document|null
Defined in: renderer/context.ts:29
The child window’s Document object. Use this to portal overlays (Radix, Base UI, etc.) to the correct document.
getDisplaySnapshot()
Section titled “getDisplaySnapshot()”getDisplaySnapshot: () =>
DisplayInfo|null
Defined in: renderer/context.ts:23
Get current display snapshot
Returns
Section titled “Returns”DisplayInfo | null
getSnapshot()
Section titled “getSnapshot()”getSnapshot: () =>
WindowState|null
Defined in: renderer/context.ts:20
Get current state snapshot
Returns
Section titled “Returns”WindowState | null
subscribe()
Section titled “subscribe()”subscribe: (
listener) => () =>void
Defined in: renderer/context.ts:17
Subscribe to state changes
Parameters
Section titled “Parameters”listener
Section titled “listener”() => void
Returns
Section titled “Returns”():
void
Returns
Section titled “Returns”void
windowId
Section titled “windowId”windowId:
string|null
Defined in: renderer/context.ts:14
Current window ID