Open nstepien opened 1 month ago
we have been thinking about this. thanks for opening this issue to remind us :)
My workaround for now seems to be to narrow the type manually by using as const satisfies LinkProps["to"];
, but this was also an issue for me, especially in shared components.
Which project does this relate to?
Router
Describe the bug
As the title says,
to
accepts thestring
type, meaning that these examples will be "valid":Your Example Website or App
https://stackblitz.com/edit/github-vg75qp?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
string
toto
Expected behavior
The
string
type should not be accepted byto
's typeScreenshots or Videos
No response
Platform
Additional context
I don't know if this is intentional, but it's making migrating away from another router more difficult as we can't automatically trust links/navigations.