suspense2.rs 352 B

12345678910111213141516
  1. use dioxus::prelude::*;
  2. use dioxus_desktop::{Config, LogicalSize, WindowBuilder};
  3. fn main() {
  4. dioxus_desktop::launch(|cx| cx.render(rsx! { async_app {} }));
  5. }
  6. async fn async_app(cx: Scope<'_>) -> Element {
  7. tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
  8. cx.render(rsx! {
  9. div {
  10. "hi!"
  11. }
  12. })
  13. }