dioxus/examples/ssr.rs
2021-07-18 03:54:42 -04:00

17 lines
305 B
Rust

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