/Knowledge/sources/honojs__hono/llms-full/jsx-streamingcontext--b0c94d66db79.md
JSX: StreamingContext - hono-docs
JSX: StreamingContext Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt streamingcontext Summary You can...
JSX: StreamingContext
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#streamingcontext
Summary
You can use StreamingContext to provide configuration for streaming components like Suspense and ErrorBoundary. This is useful for adding nonce values to script tags generated by these components for Content Security Policy (CSP)....
Content
You can use StreamingContext to provide configuration for streaming components like Suspense and ErrorBoundary. This is useful for adding nonce values to script tags generated by these components for Content Security Policy (CSP).
import { Suspense, StreamingContext } from 'hono/jsx/streaming'
// ...
app.get('/', (c) => {
const stream = renderToReadableStream(
<html>
<body>
<StreamingContext
value={{ scriptNonce: 'random-nonce-value' }}
>
<Suspense fallback={<div>Loading...</div>}>
<AsyncComponent />
</Suspense>
</StreamingContext>
</body>
</html>
)
return c.body(stream, {
headers: {
'Content-Type': 'text/html; charset=UTF-8',
'Transfer-Encoding': 'chunked',
'Content-Security-Policy':
"script-src 'nonce-random-nonce-value'",
},
})
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#streamingcontext",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / JSX > StreamingContext (1)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 26,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "JSX: StreamingContext",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}