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
like-gold•15mo ago
please provide a minimal complete example by forking on of the existing examples on stackblitz
correct-apricotOP•15mo 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
like-gold•15mo 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 componentcorrect-apricotOP•15mo 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