Skip to main content
Deno 2 is finally here 🎉️
Learn more
import * as reactDeno from "https://deno.land/x/react_deno@17.0.2/src/react_dom_server.d.ts";

Functions

Render a React element to its initial HTML. Returns a Readable stream that outputs an HTML string. The HTML output by this stream is exactly equal to what ReactDOMServer.renderToString() would return.

Similar to renderToString, except this doesn't create extra DOM attributes such as data-reactid, that React uses internally. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save lots of bytes.

Similar to renderToNodeStream, except this doesn't create extra DOM attributes such as data-reactid, that React uses internally. The HTML output by this stream is exactly equal to what ReactDOMServer.renderToStaticMarkup() would return.

Render a React element to its initial HTML. This should only be used on the server. React will return an HTML string. You can use this method to generate HTML on the server and send the markup down on the initial request for faster page loads and to allow search engines to crawl your pages for SEO purposes.