dioxus/examples/ssr.rs

18 lines
305 B
Rust
Raw Normal View History

2021-07-11 23:31:07 +00:00
use dioxus::prelude::*;
use dioxus::ssr;
fn main() {
let mut vdom = VirtualDom::new(App);
vdom.rebuild_in_place();
2021-07-18 07:54:42 +00:00
println!("{}", ssr::render_vdom(&vdom));
2021-07-11 23:31:07 +00:00
}
const App: FC<()> = |cx| {
cx.render(rsx!(
div {
h1 { "Title" }
p { "Body" }
}
))
};