You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code would produce "{productName}" as the page title.
💁 Possible Solution
Since this is all happening in the route mapping, I think all that is required is to check if the childTitle contains a match for the route parameter and interpolate the value. Much like it already does for the path.
🔦 Context
A common pattern for things like products and blog posts is to set the page title to the title of the product or post in addition to some other text.
💻 Examples
Newegg product listing
Post on Medium
The text was updated successfully, but these errors were encountered:
Yes, we definitely need it. I'm currently using a dedicated component just to update the title... not very optimized (as a result, the document title is updated twice).
Yes, we definitely need it. I'm currently using a dedicated component just to update the title... not very optimized (as a result, the document title is updated twice).
I created a method to do this recently in another project that involves hooking into the router's internals and creating a custom title builder. Unfortunately, it's hard to do right now because the types needed are all internal, but the router could be updated to export the interfaces and types.
I can submit a PR for review by the team sometime this week.
🙋 Feature Request
A nice feature I think would be the ability to interpolate route parameters into the title.
🤔 Expected Behavior
The ability to do something like this:
😯 Current Behavior
The above code would produce "{productName}" as the page title.
💁 Possible Solution
Since this is all happening in the route mapping, I think all that is required is to check if the
childTitle
contains a match for the route parameter and interpolate the value. Much like it already does for the path.🔦 Context
A common pattern for things like products and blog posts is to set the page title to the title of the product or post in addition to some other text.
💻 Examples
Newegg product listing
Post on Medium
The text was updated successfully, but these errors were encountered: