Function leptos::ssr::render_to_stream
source · pub fn render_to_stream(
view: impl FnOnce(Scope) -> View + 'static
) -> impl Stream<Item = String>Expand description
Renders a function to a stream of HTML strings.
This renders:
- the application shell
a) HTML for everything that is not under a
<Suspense/>, b) thefallbackfor any<Suspense/>component that is not already resolved, and c) JavaScript necessary to receive streaming Resource data. - 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.
- HTML fragments to replace each
<Suspense/>fallback with its actual data as the resources read under that<Suspense/>resolve.