pub fn render_to_string(view: impl FnOnce(Scope) -> Element + 'static) -> String
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>"#);