import { renderBody } from "https://deno.land/x/jsx_stream@v0.2.0/mod.ts";
Render the given JSX as a stream suitable for passing into a Response
body.
NOTE: this will not include a doctype, but there is a helper function to prepend that...
Examples
Example 1
Example 1
import { renderBody } from "@http/jsx-stream";
import { html } from "@http/response/html";
import { prependDocType } from "@http/response/prepend-doctype";
Deno.serve(() => {
return html(
prependDocType(
renderBody(
<html>
<body>
<h1>Hello World</h1>
</body>
</html>
)
)
);
});
Parameters
optional
options: RenderOptionsrendering options
Returns
A ReadableStream
of the serialized JSX