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•3y ago
Client side or server side?
fair-roseOP•3y ago
Client!
funny-blue•3y 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•3y 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•3y 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•3y ago
Looks good
fair-roseOP•3y ago
This is working well for me! Thanks both for the advice :D