Dioxus-1.rs
· 244 B · Rust
Raw
fn app() -> Element {
let mut count = use_signal(|| 0);
rsx! {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
}
}
1 | fn app() -> Element { |
2 | let mut count = use_signal(|| 0); |
3 | |
4 | rsx! { |
5 | h1 { "High-Five counter: {count}" } |
6 | button { onclick: move |_| count += 1, "Up high!" } |
7 | button { onclick: move |_| count -= 1, "Down low!" } |
8 | } |
9 | } |