dioxus/examples/ssr.rs
Jonathan Kelley cda759c659 examples: upgrade to new version of dioxus core.
also add the inline_props macro
2021-12-25 17:18:05 -05:00

17 lines
312 B
Rust

use dioxus::prelude::*;
use dioxus::ssr;
fn main() {
let mut vdom = VirtualDom::new(APP);
let _ = vdom.rebuild();
println!("{}", ssr::render_vdom(&vdom));
}
static APP: Component<()> = |cx| {
cx.render(rsx!(
div {
h1 { "Title" }
p { "Body" }
}
))
};