docs: update readme with new usestate

This commit is contained in:
Jonathan Kelley committed 2022-03-05 16:50:16 -05:00
1 parent fb1a848124
commit 977ae1d44e
2 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -14,8 +14,8 @@ fn app(cx: Scope) -> Element {
cx.render(rsx! {
div {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| *count.make_mut() += 1, "Up high!" }
button { onclick: move |_| *count.make_mut() -= 1, "Down low!" }
button { onclick: move |_| count.set(count + 1), "Up high!" }
button { onclick: move |_| count.set(count - 1), "Down low!" }
}
})
}