restore readme.rs
This commit is contained in:
1 parent
50e3216d8b
commit
1c67585ba2
1 file changed
-13
@@ -8,20 +8,7 @@ fn app() -> Element {
|
|||||||
let mut count = use_signal(|| 0);
|
let mut count = use_signal(|| 0);
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
Child { count: "High-Five counter: {count}" }
|
|
||||||
Child { count: "count" }
|
|
||||||
button { onclick: move |_| count += 1, "Up high!" }
|
button { onclick: move |_| count += 1, "Up high!" }
|
||||||
button { onclick: move |_| count -= 1, "Down low!" }
|
button { onclick: move |_| count -= 1, "Down low!" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Props, Clone, PartialEq)]
|
|
||||||
struct ChildProps {
|
|
||||||
count: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn Child(props: ChildProps) -> Element {
|
|
||||||
rsx! {
|
|
||||||
h1 { "{props.count.unwrap_or_default()}" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user