T
TanStack16mo ago
harsh-harlequin

Invalid use of Link component or bug?

<Link
className="font-bold hover:underline hover:cursor-pointer"
to="/users/$id"
params={matchingUser}
// onClick={() => navigate({ to: "/users/$id", params: matchingUser })}
>
{matchingUser.display_name}
</Link>{" "}
<Link
className="font-bold hover:underline hover:cursor-pointer"
to="/users/$id"
params={matchingUser}
// onClick={() => navigate({ to: "/users/$id", params: matchingUser })}
>
{matchingUser.display_name}
</Link>{" "}
I have this bit of code in https://gist.github.com/Gobot1234/96c39524d495f4f85841758372b8b729 but when I render this component I get
chunk-CA2AZK23.js?v=b0d34825:9145 Uncaught TypeError: Cannot read properties of null (reading '__store')
at useRouterState (@tanstack_react-router.js?v=b0d34825:410:76)
at useMatch (@tanstack_react-router.js?v=b0d34825:891:26)
at useLinkProps (@tanstack_react-router.js?v=b0d34825:3179:26)
at @tanstack_react-router.js?v=b0d34825:3363:34
at renderWithHooks (chunk-CA2AZK23.js?v=b0d34825:11568:26)
at updateForwardRef (chunk-CA2AZK23.js?v=b0d34825:14345:28)
at beginWork (chunk-CA2AZK23.js?v=b0d34825:15966:22)
at beginWork$1 (chunk-CA2AZK23.js?v=b0d34825:19781:22)
at performUnitOfWork (chunk-CA2AZK23.js?v=b0d34825:19226:20)
at workLoopSync (chunk-CA2AZK23.js?v=b0d34825:19165:13)
chunk-CA2AZK23.js?v=b0d34825:9145 Uncaught TypeError: Cannot read properties of null (reading '__store')
at useRouterState (@tanstack_react-router.js?v=b0d34825:410:76)
at useMatch (@tanstack_react-router.js?v=b0d34825:891:26)
at useLinkProps (@tanstack_react-router.js?v=b0d34825:3179:26)
at @tanstack_react-router.js?v=b0d34825:3363:34
at renderWithHooks (chunk-CA2AZK23.js?v=b0d34825:11568:26)
at updateForwardRef (chunk-CA2AZK23.js?v=b0d34825:14345:28)
at beginWork (chunk-CA2AZK23.js?v=b0d34825:15966:22)
at beginWork$1 (chunk-CA2AZK23.js?v=b0d34825:19781:22)
at performUnitOfWork (chunk-CA2AZK23.js?v=b0d34825:19226:20)
at workLoopSync (chunk-CA2AZK23.js?v=b0d34825:19165:13)
if I use a div with an onclick navigate that works
Gist
index.tsx
GitHub Gist: instantly share code, notes, and snippets.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?