Function yew_hooks::use_update
source · [−]Expand description
A hook returns a function that forces component to re-render when called.
Example
#[function_component(Update)]
fn update() -> Html {
let update = use_update();
let onclick = Callback::from(move |_| {
update();
});
html! {
<>
<button {onclick}>{ "Update" }</button>
</>
}
}