Create closure type; allow async event handlers in props; allow short hand event handlers (#2437)

* create closure type; allow async event handlers in props; allow shorthand event handlers

* test forwarding event handlers with the shorthand syntax

* fix clippy

* fix imports in spawn async doctest
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-06-10 18:47:07 -07:00
1 parent 79e18c2d62
commit d795995e20
11 files changed
+294 -103

No files matched your search

+1 -1
View File
@@ -89,7 +89,7 @@ fn app() -> Element {
#[component]
fn CalculatorKey(name: String, onclick: EventHandler<MouseEvent>, children: Element) -> Element {
rsx! {
button { class: "calculator-key {name}", onclick: move |e| onclick.call(e), {&children} }
button { class: "calculator-key {name}", onclick, {children} }
}
}