TanStackT
TanStack2y ago
2 replies
broad-emerald

Link params type error

I have an item component that includes an edit button that should navigate to current route + '$id'. When using the Link component and include id in params, I receive the following error:

Object literal may only specify known properties, and 'id' does not exist in type '(current: {} | { category: string; } | {} | { id: string; } | { id: string; } | { category: string; id: string; }) => never'.ts(2353)


<Link
 to={`./$id/`}
 params={{ id: data.id }}
 >
Was this page helpful?