remove cx.render

This commit is contained in:
Jonathan Kelley committed 2024-01-13 21:12:21 -08:00
1 parent fae0b08e61
commit 1dde044697
159 files changed
+600 -658

No files matched your search

+6 -5
View File
@@ -38,9 +38,9 @@ fn main() {
const STYLE: &str = include_str!("./assets/calculator.css");
fn app() -> Element {
let state = use_ref(Calculator::new);
let state = use_signal(Calculator::new);
cx.render(rsx! {
rsx! {
style { {STYLE} }
div { id: "wrapper",
div { class: "app",
@@ -117,24 +117,25 @@ fn app() -> Element {
}
}
}
})
}
}
#[derive(Props)]
struct CalculatorKeyProps {
#[props(into)]
name: String,
onclick: EventHandler<MouseEvent>,
children: Element,
}
fn CalculatorKey(props: CalculatorKeyProps) -> Element {
cx.render(rsx! {
rsx! {
button {
class: "calculator-key {cx.props.name}",
onclick: move |e| cx.props.onclick.call(e),
{&cx.props.children}
}
})
}
}
struct Calculator {