Skip to content

Commit

Permalink
Merge pull request #218 from activeguild/master
Browse files Browse the repository at this point in the history
fix: update the sample
  • Loading branch information
jkelleyrtp authored Feb 8, 2022
2 parents 3f5b8b2 + abbd0b8 commit ec2fb84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docs/guide/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
**Dioxus** is a framework and ecosystem for building fast, scalable, and robust user interfaces with the Rust programming language. This guide will help you get started with Dioxus running on the Web, Desktop, Mobile, and more.

```rust
fn App(cx: Scope) -> Element {
let mut count = use_state(&cx, || 0);
fn app(cx: Scope) -> Element {
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!" }
))
};
```
Expand Down
6 changes: 3 additions & 3 deletions notes/README/ZH_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ Dioxus 是一个可移植、高性能的框架,用于在 Rust 中构建跨平

```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!" }
))
}
```
Expand Down

0 comments on commit ec2fb84

Please sign in to comment.