fix: exampels
This commit is contained in:
1 parent
5c4bd0881b
commit
a8952a9ee8
14 files changed
+400
-285
No files matched your search
+3
-3
@@ -9,13 +9,13 @@ fn main() {
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
let count = use_state(&cx, || 0);
|
||||
let (count, set_count) = use_state(&cx, || 0);
|
||||
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
h1 { "High-Five counter: {count}" }
|
||||
button { onclick: move |_| *count.modify() += 1, "Up high!" }
|
||||
button { onclick: move |_| *count.modify() -= 1, "Down low!" }
|
||||
button { onclick: move |_| set_count(count + 1), "Up high!" }
|
||||
button { onclick: move |_| set_count(count - 1), "Down low!" }
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user