/Knowledge/sources/honojs__hono/llms-full/jsx-renderer-middleware-options-function-based-options--ebbaeedf13f6.md
JSX Renderer Middleware: Options > Function-based Options - hono-docs
JSX Renderer Middleware: Options Function based Options Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.tx...
JSX Renderer Middleware: Options > Function-based Options
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#function-based-options
Summary
You can pass a function that receives a Context object instead of a static options object. This allows you to dynamically set options based on the request context, such as environment variables or request parameters. ```tsx app.use( '*...
Content
You can pass a function that receives a Context object instead of a static options object. This allows you to dynamically set options based on the request context, such as environment variables or request parameters.
app.use(
'*',
jsxRenderer(
({ children }) => {
return (
<html>
<body>{children}</body>
</html>
)
},
(c) => ({
stream: c.req.header('X-Enable-Streaming') === 'true',
})
)
)
As a concrete example, you can use this to disable streaming when generating static sites (SSG) with <Suspense>, by using the isSSGContext helper:
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#function-based-options",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / JSX Renderer Middleware > Options > Function-based Options (1)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 240,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "JSX Renderer Middleware: Options > Function-based Options",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}