custom link with createLink doesnt render the Link component
I'm trying to create a custom Link wrapper.
Gives perfect intellisense for the route when I'm using it, but It only renders the custom children provided and no actual Link around it, how could I fix that? what am i doing wrong?
4 Replies
tame-yellow•2y ago
please provide a minimal complete example by forking on of the existing examples on stackblitz
quickest-silverOP•2y ago
gergelykisshun
StackBlitz
Router Basic File Based Example (forked) - StackBlitz
Run official live example code for Router Basic File Based, created by Tanstack on StackBlitz
tame-yellow•2y ago
If you want to use your own component, you also need need to render the "link" yourself
it could be a
<button>, or and <a>...
it's totally up to you
what you get via createLink is a typesafe wrapper around your componentquickest-silverOP•2y ago
thank you for the help! Added a Link component to wrap my custom content, and passed the generated href to it. works fine and generates safe Link