import { renderString } from "https://deno.land/x/jsx_stream@v0.2.0/serialize.ts";
Render the given JSX as a string.
This is an alternative to renderBody
for situations that
require just a string, or where streaming is not necessary or possible.
Prefer renderBody
when rendering for a Response
over this.
Examples
Example 1
Example 1
console.log(renderString(
<html>
<body>
<h1>Hello World</h1>
</body>
</html>
));
Parameters
optional
options: Pick<RenderOptions, "tagHandlers">rendering options