route's title does not work
See original GitHub issueI have the following routes:
mount({
'/': route({
title: 'Home',
view: <Home />,
}),
'/about': route({
title: 'About',
view: <About />,
}),
}))
but as it renders, the title of the browser tab is not set, is it expected behavior?
I’m not using react-helmet
and static rendering
Do I need to use react-helmet
for it to work?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
Why I get this error trying to set page title? - angular
The Router sets the document's title using the title property from the Route config. But I get this error: Type '{ path: string;...
Read more >Title does not change while changing routes - Next js 13 appDir
Expected Behavior. Title should change when the route changes. Link to reproduction - Issues with a link to complete (but minimal) reproduction ...
Read more >How to Update the Application Title based on Routing ...
Just open the following link in your browser: https://luixaviles.github.io/angular-update-title. Find the complete angular project in this ...
Read more >Setting Page Titles Natively With The Angular Router
First, you would use the data property in the Route object with a title ... Now, let's look at the new way page...
Read more >Angular's new router title feature | by Kevin Kreuzer - Medium
In Angular v14 we don't have to implement the logic we explored above anymore. We simply have to use the new title property...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it’s fine to let the router manage the title, router is responsible for rendering pages, title is a page property, so why not?
And I definitely wouldn’t like to manage titles in components, components are meant to be reused, composed, so it’s better to keep them away from global stuff and free from side effects.
Thus, I prefer letting the router do it. Anyway It’s just my opinion.
I wouldn’t let routing decide that. It falls out of its responsibility, imho. Instead, any rendered component (view) can render things that affect page’s title and other attributes.
react-helmet
, for instance, allows to control per-component title, meta, body and other attributes.Those solutions usually provide API for server-side rendering. I’m brining this because it feels it would be too much for Navi to handle.