Bring back mroe hooks, remove old hooks, cleanup a number of examples
This commit is contained in:
33 files changed
+179
-643
No files matched your search
@@ -120,20 +120,17 @@ fn app() -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Props)]
|
||||
struct CalculatorKeyProps {
|
||||
#[props(into)]
|
||||
name: String,
|
||||
#[component]
|
||||
fn CalculatorKey(
|
||||
#[props(into)] name: String,
|
||||
onclick: EventHandler<MouseEvent>,
|
||||
children: Element,
|
||||
}
|
||||
|
||||
fn CalculatorKey(props: CalculatorKeyProps) -> Element {
|
||||
) -> Element {
|
||||
rsx! {
|
||||
button {
|
||||
class: "calculator-key {cx.props.name}",
|
||||
onclick: move |e| cx.props.onclick.call(e),
|
||||
{&cx.props.children}
|
||||
class: "calculator-key {name}",
|
||||
onclick: move |e| onclick.call(e),
|
||||
{&children}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user