feat: re-unify set_state
This commit is contained in:
1 parent
3928856a9b
commit
6c3f5195f4
16 files changed
+199
-136
No files matched your search
@@ -7,7 +7,7 @@ fn main() {
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
let (model, set_model) = use_state(&cx, || String::from("asd"));
|
||||
let model = use_state(&cx, || String::from("asd"));
|
||||
|
||||
println!("{}", model);
|
||||
|
||||
@@ -17,7 +17,7 @@ fn app(cx: Scope) -> Element {
|
||||
rows: "10",
|
||||
cols: "80",
|
||||
value: "{model}",
|
||||
oninput: move |e| set_model(e.value.clone()),
|
||||
oninput: move |e| model.set(e.value.clone()),
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user