ssr.rs 305 B

1234567891011121314151617
  1. use dioxus::prelude::*;
  2. use dioxus::ssr;
  3. fn main() {
  4. let mut vdom = VirtualDom::new(App);
  5. vdom.rebuild_in_place();
  6. println!("{}", ssr::render_root(&vdom));
  7. }
  8. const App: FC<()> = |cx| {
  9. cx.render(rsx!(
  10. div {
  11. h1 { "Title" }
  12. p { "Body" }
  13. }
  14. ))
  15. };