Meta Tags & SEO
what's the best approach to this using tanstack router?
6 Replies
vicious-goldOP•16mo ago
ping
foreign-sapphire•16mo ago
If you're using vite, I just modify the
head tag inside /index.html, anything page specific I just use https://www.npmjs.com/package/react-helmetnpm
react-helmet
A document head manager for React. Latest version: 6.1.0, last published: 4 years ago. Start using react-helmet in your project by running
npm i react-helmet. There are 4575 other projects in the npm registry using react-helmet.conscious-sapphire•16mo ago
I use a hook for this.
https://github.com/SeanCassiere/nv-rental-clone/blob/master/src/lib/hooks/useDocumentTitle.ts
https://github.com/SeanCassiere/nv-rental-clone/blob/718d19c3715c3cb75e082865320e319ec10ef461/src/routes/_auth/(dashboard)/index.tsx#L142
GitHub
nv-rental-clone/src/lib/hooks/useDocumentTitle.ts at master · SeanC...
Navotar with Tailwind and the Tanstack. Contribute to SeanCassiere/nv-rental-clone development by creating an account on GitHub.
GitHub
nv-rental-clone/src/routes/_auth/(dashboard)/index.tsx at 718d19c37...
Navotar with Tailwind and the Tanstack. Contribute to SeanCassiere/nv-rental-clone development by creating an account on GitHub.
correct-apricot•16mo ago
I saw this part of your code
If I don't use promise.all here ensureQueryData would cause a waterfall right? cause I didn't really check but seeing this made me realize in my project I didn't do this
conscious-sapphire•16mo ago
Yup!
Whenever the order of the promise execution doesn't matter, I "collect" them and throw into a
Promise.all or Promise.allSettledcorrect-apricot•16mo ago
Thanks fixed my project to use this
The order of execution doesn't matter