useWindowDocument
useWindowDocument():
Document
Defined in: renderer/hooks/useWindowState.ts:19
Returns the child window’s Document object.
Use this to portal UI library overlays (Radix UI, Base UI, etc.) to the correct document — Radix’s default is the parent window’s document, which causes portals to render in the wrong window.
In dev/test, the returned Document is wrapped in a Proxy that warns on access after the window closes — catches the common leak of stashing the document in a ref or closure past its lifecycle.
Returns
Section titled “Returns”Document
Throws
Section titled “Throws”if called outside an open <Window> or <PooledWindow>