How to props typesafety for a LinkCard component?
Basically I want my
<LinkCard>
component to error the same way <Link>
from @tanstack/router
if you fail to give it a to=""
prop
This works, but it doesn't have the same level of typesafety as the native <Link>
tag.

3 Replies
wise-whiteOP•5mo ago
now params for $me is included despite not being in the route
continuing-cyan•5mo ago
this should help
https://tanstack.com/router/latest/docs/framework/react/guide/type-utilities#type-checking-link-options-with-validatelinkoptions
Type Utilities | TanStack Router React Docs
Most types exposed by TanStack Router are internal, subject to breaking changes and not always easy to use. That is why TanStack Router has a subset of exposed types focused on ease of use with the in...
wise-whiteOP•5mo ago
that works until I want my until i add children to my component.
nvm, I figured it out by just adding
children: React.ReactNode
to the props! thanks a lot!