T
TanStack12mo ago
ratty-blush

href prop not working on `Link` component?

I am confused. What am I missing? https://stackblitz.com/edit/tanstack-router-tn3dvcbd?file=src%2Froutes%2Findex.tsx I have a Link component with href set to "https://google.com". I would expect this to display an anchor with that URL
4 Replies
absent-sapphire
absent-sapphire12mo ago
link is not for external targets just use an <a>
ratty-blush
ratty-blushOP12mo ago
OK thanks for the info! What is the href attribute about then? 🤔
absent-sapphire
absent-sapphire12mo ago
href is calculated by router for internal links so that you can open an internal link in a new tab
ratty-blush
ratty-blushOP12mo ago
OK! Thanks for the quick support, that's awesome 🙏

Did you find this page helpful?