mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
use impl trait in props
This commit is contained in:
parent
c360f0ed0d
commit
4e4deef144
1 changed files with 2 additions and 4 deletions
|
@ -66,12 +66,10 @@ pub fn ButtonA(
|
|||
|
||||
/// Button B receives a closure
|
||||
#[component]
|
||||
pub fn ButtonB<F>(
|
||||
pub fn ButtonB(
|
||||
/// Callback that will be invoked when the button is clicked.
|
||||
on_click: F,
|
||||
on_click: impl FnMut(MouseEvent) + 'static,
|
||||
) -> impl IntoView
|
||||
where
|
||||
F: FnMut(MouseEvent) + 'static,
|
||||
{
|
||||
view! { <button on:click=on_click>"Toggle Right"</button> }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue