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
@@ -9,7 +9,7 @@ fn main() {
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
let (contents, set_contents) = use_state(&cx, || {
|
||||
let contents = use_state(&cx, || {
|
||||
String::from("<script>alert(\"hello world\")</script>")
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ fn app(cx: Scope) -> Element {
|
||||
input {
|
||||
value: "{contents}",
|
||||
r#type: "text",
|
||||
oninput: move |e| set_contents(e.value.clone()),
|
||||
oninput: move |e| contents.set(e.value.clone()),
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user