mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-26 14:10:20 +00:00
docs: fix readme
This commit is contained in:
parent
75b1cff915
commit
6073bddf30
1 changed files with 3 additions and 3 deletions
|
@ -65,12 +65,12 @@ Dioxus is a portable, performant, and ergonomic framework for building cross-pla
|
|||
|
||||
```rust
|
||||
fn app(cx: Scope) -> Element {
|
||||
let mut count = use_state(&cx, || 0);
|
||||
let (count, set_count) = use_state(&cx, || 0);
|
||||
|
||||
cx.render(rsx!(
|
||||
h1 { "High-Five counter: {count}" }
|
||||
button { onclick: move |_| count += 1, "Up high!" }
|
||||
button { onclick: move |_| count -= 1, "Down low!" }
|
||||
button { onclick: move |_| set_count(count + 1), "Up high!" }
|
||||
button { onclick: move |_| set_count(count - 1), "Down low!" }
|
||||
))
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue