Function leptos_dom::ssr::render_to_stream

source ·
pub fn render_to_stream(
    view: impl FnOnce() -> View + 'static
) -> impl Stream<Item = String>
Expand description

Renders a function to a stream of HTML strings.

This renders:

  1. the application shell a) HTML for everything that is not under a <Suspense/>, b) the fallback for any <Suspense/> component that is not already resolved, and c) JavaScript necessary to receive streaming Resource data.
  2. streaming Resource data. Resources begin loading on the server and are sent down to the browser to resolve. On the browser, if the app sees that it is waiting for a resource to resolve from the server, it doesn’t run it initially.
  3. HTML fragments to replace each <Suspense/> fallback with its actual data as the resources read under that <Suspense/> resolve.