Function leptos_dom::render_to_string
source · Expand description
Renders a component to a static HTML string.
let html = render_to_string(|cx| view! { cx,
<p>"Hello, world!"</p>
});
assert_eq!(html, r#"<p data-hk="0-0">Hello, world!</p>"#);