vdom_usage.rs 367 B

123456789101112131415
  1. use std::time::Duration;
  2. use dioxus_core::prelude::*;
  3. #[async_std::main]
  4. async fn main() {
  5. static App: FC<()> = |cx| cx.render(LazyNodes::new(|f| f.text(format_args!("hello"))));
  6. let mut dom = VirtualDom::new(App);
  7. dom.rebuild();
  8. let deadline = async_std::task::sleep(Duration::from_millis(50));
  9. let _fut = dom.run_with_deadline(deadline);
  10. }