DEFAULT_DOCUMENT

const
Browser & Runtime

Reference to window.document when running in a browser, or undefined during SSR. Derived from IN_BROWSER. Components that need to query the DOM use this instead of accessing window.document directly so SSR environments do not throw ReferenceError.

TypeScript

Definition

The TypeScript definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

Resolved value

Ecosystem

Used by

Composables and components that consume this constant.

Usage

Examples

Ready-to-paste code snippets using this constant.

Querying the document safely in SSR-aware code

typescript