main.rs 469 B

1234567891011121314151617
  1. //! Static generation lets you pre-render your entire app to static files and then hydrate it on the client.
  2. use dioxus::prelude::*;
  3. // Generate all routes and output them to the static path
  4. fn main() {
  5. launch(app);
  6. }
  7. fn app() -> Element {
  8. let mut count = use_signal(|| 0);
  9. rsx! {
  10. h1 { "High-Five counter: {count}" }
  11. button { onclick: move |_| count += 1, "Up high!" }
  12. button { onclick: move |_| count -= 1, "Down low!" }
  13. }
  14. }