chore: rename all &cx to cx, make clipppy happy
This commit is contained in:
1 parent
e8133e9449
commit
4eefc3f854
85 files changed
+256
-271
No files matched your search
+2
-2
@@ -233,7 +233,7 @@ use hooks to define state and modify it from within listeners.
|
||||
|
||||
```rust, ignore
|
||||
fn app(cx: Scope) -> Element {
|
||||
let name = use_state(&cx, || "world");
|
||||
let name = use_state(cx, || "world");
|
||||
|
||||
render!("hello {name}!")
|
||||
}
|
||||
@@ -280,7 +280,7 @@ fn main() {
|
||||
}
|
||||
|
||||
fn App(cx: Scope) -> Element {
|
||||
let count = use_state(&cx, || 0);
|
||||
let count = use_state(cx, || 0);
|
||||
|
||||
cx.render(rsx!(
|
||||
div { "Count: {count}" }
|
||||
|
||||
@@ -54,7 +54,7 @@ Dioxus 是一个可移植的、高性能的、符合人体工程学的框架,
|
||||
|
||||
```rust
|
||||
fn app(cx: Scope) -> Element {
|
||||
let mut count = use_state(&cx, || 0);
|
||||
let mut count = use_state(cx, || 0);
|
||||
|
||||
cx.render(rsx! {
|
||||
h1 { "High-Five counter: {count}" }
|
||||
|
||||
@@ -406,8 +406,8 @@ enum Patch {
|
||||
```
|
||||
|
||||
```rust
|
||||
let node_ref = use_node_ref(&cx);
|
||||
use_effect(&cx, || {
|
||||
let node_ref = use_node_ref(cx);
|
||||
use_effect(cx, || {
|
||||
|
||||
}, []);
|
||||
div { ref: node_ref,
|
||||
|
||||
Reference in new issue
Block a user