Function yew_hooks::use_unmount[][src]

pub fn use_unmount<Callback>(callback: Callback) where
    Callback: FnOnce() + 'static, 
Expand description

A lifecycle hook that calls a function when the component will unmount.

Example

#[function_component(Unmount)]
fn unmount() -> Html {
    use_unmount(|| {
        debug!("Running clean-up of effect on unmount");
    });
     
    html! {
        <>
        </>
    }

}