Type error <Link to={"./"} />
Hello, idk how to solve this type error, the link is working fine as it should be, but this red line is so annoying

12 Replies
sunny-greenOP•13mo ago

sunny-greenOP•13mo ago
harsh-harlequin•13mo ago
if you want relative routes, you need to specify
from
sunny-greenOP•13mo ago
ty. but now "search" type is missing, what it should be?

harsh-harlequin•13mo ago
does your route have search params?
sunny-greenOP•13mo ago
yea
/clube/qg88qo663stz97r/curso/ryu6o9q5g0w7k55
$clubId and $courseId
I wanna go back from
/clube/qg88qo663stz97r/curso/ryu6o9q5g0w7k55
to
/clube/qg88qo663stz97r
I think I have path params
idk the correct nomenclature
harsh-harlequin•13mo ago
but do you have search params?
sunny-greenOP•13mo ago
no
harsh-harlequin•13mo ago
might be this bug then: https://github.com/TanStack/router/issues/1838
GitHub
Relative navigation always expects a
search
param? · Issue #1838 ...Describe the bug When using navigation (e.g. navigate / redirect) with a from and relative to, it seems TypeScript always complains about the search param being required, even if none of the routes...
harsh-harlequin•13mo ago
so try linking
to="../.."
instead of to="../../"
(notice the trailing slash)sunny-greenOP•13mo ago
oh nice, you are insane, such a dumb thing
all fine now
sensitive-blue•13mo ago
Yeah. I guess I should fix this. It's to do with trailing slashes. We should have a better type error and not allow the trailing slash with
never
set