Renders a view component with the given props to an HTML string.
Interpolations are escaped by the RENDERING RUNTIME — the JSX runtime and
the html tagged template both escape — and a component opts out with
hono's own raw(), never with engine-level configuration.
The escaping is therefore a property of how a component is WRITTEN, not a
guarantee this port makes. A plain (props) => string component is a
valid Component and its output is returned unchanged:
correct for a by-name engine whose compiled template has already escaped
its own interpolations, and an XSS hole for a hand-written template
literal such as (p) => `<p>${p.name}</p>` . Prefer JSX or the html
tag; reach for a plain string only when the producer already escaped.
The component's props bag
The rendered HTML, buffering before send — never a stream
View engine contract — renders a view component and its props to HTML.
Registered under
CAPABILITIES.VIEW('view'). Every entry point reaches the SAME engine instance: the@Renderdecorator resolves it once atregister()and the freerenderViewfunction resolves it per request, so an application's configured engine and options govern both.The return is a union because an async component's render genuinely is a promise — the async arm is required, not speculative.
Example
Since
0.6.0