T
TanStack3y ago
fair-rose

Can you edit a title via TanStack Router?

Hey, using the router to handling routing to pages - Is there a way to handle changing the meta title? For context; using React 18.2, Vite 3.2.3, @tanstack/react-router 0.0.1-beta.28
7 Replies
funny-blue
funny-blue3y ago
Client side or server side?
fair-rose
fair-roseOP3y ago
Client!
funny-blue
funny-blue3y ago
I think you'd need to use a utility like Helmet Or, just write your own hook/component that can updated the head in an effect
funny-blue
funny-blue3y ago
GitHub
GitHub - nfl/react-helmet: A document head manager for React
A document head manager for React. Contribute to nfl/react-helmet development by creating an account on GitHub.
foreign-sapphire
foreign-sapphire3y ago
Am a bit late on this but React Helmet isn't really maintained anymore and I can wholeheartedly suggest https://github.com/0no-co/hoofd as an alternative
GitHub
GitHub - 0no-co/hoofd: Hooks to populate the html head.
Hooks to populate the html head. Contribute to 0no-co/hoofd development by creating an account on GitHub.
funny-blue
funny-blue3y ago
Looks good
fair-rose
fair-roseOP3y ago
This is working well for me! Thanks both for the advice :D

Did you find this page helpful?