-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
typesChanges to the typescript typesChanges to the typescript types
Description
Which project does this relate to?
Router
Describe the bug
despite the docs:
router/docs/router/framework/react/guide/path-params.md
Lines 409 to 414 in 410fdf8
| <Link | |
| to="/posts/{-$category}" | |
| params={{ category: 123 }} // ✅ Valid - number (auto-stringified) | |
| > | |
| Category 123 | |
| </Link> |
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
- create any route with params e.g
$foo.bar.tsx <Link to="/$foo/bar" params={{ foo: 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
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.
GjorgjievskiMarko
Metadata
Metadata
Assignees
Labels
typesChanges to the typescript typesChanges to the typescript types