/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-function-based-opti-f1a85548305f-function-based-options-s0240-c0000.md
Function-based Options (1) - hono-docs
Function based Options (1) Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt function based options...
Function-based Options (1)
Source evidence: /Sources/raw/honojshono/honojshono.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: