restore readme.rs

This commit is contained in:
Evan Almloff committed 2024-01-29 13:37:00 -06:00
1 parent 50e3216d8b
commit 1c67585ba2
1 file changed
-13
-13
View File
@@ -8,20 +8,7 @@ fn app() -> Element {
let mut count = use_signal(|| 0);
rsx! {
Child { count: "High-Five counter: {count}" }
Child { count: "count" }
button { onclick: move |_| count += 1, "Up high!" }
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()}" }
}
}