Function use_favicon

Source
pub fn use_favicon<'hook>(href: String) -> impl 'hook + Hook<Output = ()>
Expand description

A side-effect hook that sets favicon of the page.

§Example

use yew_hooks::prelude::*;

#[function_component(Favicon)]
fn favicon() -> Html {
    use_favicon("https://crates.io/favicon.ico".to_string());
    
    html! {
        <>
        </>
    }
}

§Note

When used in function components and hooks, this hook is equivalent to:

pub fn use_favicon(href: String) {
    /* implementation omitted */
}