react-helmet
react-helmet copied to clipboard
How do I append a value to the title?
Is there a way to append an additional value to all page titles?
For example, something like:
${helmet.title.append(` - ${process.env.APP_NAME}`).toString()}
you can use titleTemplate
<Helmet
defaultTitle={process.env.APP_NAME}
titleTemplate={%s - ${process.env.APP_NAME} }
/>
output
Yeah but I'd have to put that in every component right?
Was wondering if there was a global way to apply it to all my components.
you don't need to put in every component. you can add it on the root index.js file or routes.js file