Skip to content

Change title #2960

Answered by futursolo
DenuxPlays asked this question in Q&A
Nov 11, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

You can set the title in an effect hook of that page.

#[function_component]
fn PageA() -> Html {
    use_effect_with_deps(|_| {
        gloo::utils::document().set_title("Page A");
    }, ());

    html!{ ... }
}

There are also third party libraries that provides manipulation of elements in <head></head> like (bounce::helmet).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@DenuxPlays
Comment options

@WorldSEnder
Comment options

@DenuxPlays
Comment options

Answer selected by DenuxPlays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants