T
TanStack3y ago
ratty-blush

Link Component is requiring search prop

I've been trying to use the link component, but they all have type errors because they say that the search prop is required. Would love more info here.
No description
10 Replies
like-gold
like-gold3y ago
ratty-blush
ratty-blushOP3y ago
ok, this wasn't a custom link component though, imported strait from tanstack
like-gold
like-gold3y ago
can you share type for navigation array
ratty-blush
ratty-blushOP3y ago
welp just figured out adding as const fixed it for me
like-gold
like-gold3y ago
same error if you set type to string
No description
ratty-blush
ratty-blushOP3y ago
No description
like-gold
like-gold3y ago
you can remove as const and set type to
{
href: RegisteredRoutesInfo["routePaths"];
name: ReactNode | string;
}[]
{
href: RegisteredRoutesInfo["routePaths"];
name: ReactNode | string;
}[]
ratty-blush
ratty-blushOP3y ago
I knew this was typesafe, but dang
like-gold
like-gold3y ago
we had a whole discussion about it, will see be added to docs
judicial-coral
judicial-coral3y ago
I meant it!

Did you find this page helpful?