T
TanStack•12mo ago
jolly-crimson

Correct way to add favicon?

Hello, I'm wondering what's the correct way to add favicon? While looking at examples, I see that most of the metadata are added through meta in createRootRoute, but after trying for a while, I cannot figure out what to put there to render <link />. The only way I managed to add favicon in a way that is actually displayed is through this code inside RootDocument:
<Meta>
<link
rel="icon"
href="/favicon/favicon.svg"
type="image/svg"
sizes="any"
/>
</Meta>
<Meta>
<link
rel="icon"
href="/favicon/favicon.svg"
type="image/svg"
sizes="any"
/>
</Meta>
But I feel this is not the right way to do this. First of all, this adds the <link/> to <head> twice in the actual html. Plus I feel this would make it impossible to display different favicons for different routes, which doesn't feel right.
2 Replies
rising-crimson
rising-crimson•12mo ago
No description
jolly-crimson
jolly-crimsonOP•12mo ago
Thanks! 🤦

Did you find this page helpful?