diff --git a/docs/guide/src/state/localstate.md b/docs/guide/src/state/localstate.md index 72dcdb619..788399cb5 100644 --- a/docs/guide/src/state/localstate.md +++ b/docs/guide/src/state/localstate.md @@ -19,8 +19,8 @@ cx.render(rsx!{ ul { todos.read().iter().enumerate().map(|(id, todo)| rsx!{ li { + onhover: move |_| *todos.write()[id].is_hovered = true, h1 { "{todo.contents}" } - onhover: move |_| *todos.write()[id].is_hovered = true; } }) } diff --git a/docs/reference/src/platforms/mobile.md b/docs/reference/src/platforms/mobile.md index 5a41ffe60..193487885 100644 --- a/docs/reference/src/platforms/mobile.md +++ b/docs/reference/src/platforms/mobile.md @@ -1,15 +1,15 @@ # Getting started: mobile -Dioxus is unique in that it actually supports mobile. However, support is very young and you might need to dip down into some of the primitives until better supported is ready. +Dioxus is unique in that it actually supports mobile. However, support is very young and you might need to dip down into some of the primitives until better support is ready. -Currently, only iOS is supported through us, however you *can* add android support by following the same instructions below, but using the `android` guide in `cargo-mobile`. +Currently, only iOS is supported through us, however you *can* add android support by following the same instructions below by using the `android` guide in `cargo-mobile`. Also, Dioxus Desktop and Dioxus Mobile share the same codebase, and dioxus-mobile currently just re-exports dioxus-desktop. ## Getting Set up -Getting set up with mobile can but quite challenging. The tooling here isn't great (yet) and might take some hacking around to get things working. macOS M1 is broadly unexplored and might not work for you. +Getting set up with mobile can be quite challenging. The tooling here isn't great (yet) and might take some hacking around to get things working. macOS M1 is broadly unexplored and might not work for you. We're going to be using `cargo-mobile` to build for mobile. First, install it: diff --git a/notes/README/ZH_CN.md b/notes/README/ZH_CN.md index 79f2b51aa..4da075c7d 100644 --- a/notes/README/ZH_CN.md +++ b/notes/README/ZH_CN.md @@ -65,13 +65,13 @@ Dioxus 是一个可移植、高性能的框架,用于在 Rust 中构建跨平 ```rust fn app(cx: Scope) -> Element { - let (count, set_count) = use_state(&cx, || 0); + let mut count = use_state(&cx, || 0); - cx.render(rsx!( + cx.render(rsx! { h1 { "High-Five counter: {count}" } - button { onclick: move |_| set_count(count + 1), "Up high!" } - button { onclick: move |_| set_count(count - 1), "Down low!" } - )) + button { onclick: move |_| count += 1, "Up high!" } + button { onclick: move |_| count -= 1, "Down low!" } + }) } ```