Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fresh/server.ts>RenderContext

The next-gen web framework.
Extremely Popular
Go to Latest
class RenderContext
import { RenderContext } from "https://deno.land/x/fresh@1.7.1/server.ts";

Constructors

new
RenderContext(
id: string,
url: URL,
route: string,
lang: string,
)

Properties

readonly
id: string

A unique ID for this logical JIT render.

lang: string

The language of the page being rendered. Defaults to "en".

readonly
route: string

The route matcher (e.g. /blog/:id) that the request matched for this page to be rendered.

readonly
state: Map<string, unknown>

State that is persisted between multiple renders with the same render context. This is useful because one logical JIT render could have multiple preact render passes due to suspense.

readonly
styles: string[]

All of the CSS style rules that should be inlined into the document. Adding to this list across multiple renders is supported (even across suspense!). The CSS rules will always be inserted on the client in the order specified here.

readonly
url: URL

The URL of the page being rendered.