Skip to content
Source
Sign inSign up
TanStack/router

type error when passing number to `Link.params` #5559

Send to my agent
Openscarf005(GitHub profile, opens in a new tab) opened this issue 0 comments

Which project does this relate to?

Router

Describe the bug

despite the docs: https://github.com/TanStack/router/blob/410fdf808d959de0efb92a9d1339048a7cd053f1/docs/router/framework/react/guide/path-params.md?plain=1#L409-L414

putting numbers in params on Link component gives type error

Your Example Website or App

https://stackblitz.com/edit/github-ynvn4fan?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. create any route with params e.g $foo.bar.tsx
  2. <Link to="/$foo/bar" params={{ foo: 3 }}>
  3. get type error that you cannot assign number to string

Expected behavior

type works like the docs the numbers do get auto-stringified, but the type error makes everything cumbersome (have to wrap in String)

Screenshots or Videos

Image

Platform

  • Router / Start Version: 1.133.20
  • OS: macOS
  • Browser: Firefox
  • Browser Version: 145.0b3
  • Bundler: vite
  • Bundler Version: 7.1.7

Additional context

for some reason this error isn't reproducible on tanstack/router repo.

Sign in to join this conversation.