ValidateLinkOptions throwing type error when trying to add search params through function.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Router
Describe the bug
The search option is throwing a type error when trying to setup linkOptions props. While the code navigates properly, the type is
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-4gmm6ikn?file=src%2Froutes%2Fabout.tsx
Steps to Reproduce the Bug or Issue
Go to About page in code,
Hover type error on
<HeadingLink
title="Three"
linkOptions={{
to: '/posts',
search: (prev) => ({ ...prev, tag: 'three' }),
}}
/>
```
### Expected behavior
I expect the search options to work with typesafety as 'to' 'from' etc do
### Screenshots or Videos
_No response_
### Platform
- Router / Start Version: 1.132.47
- OS: MacOS
- Browser: Chrome
- Bundler: vite
- Bundler Version: 7.1.7
### Additional context
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the About page in the linked StackBlitz reproduction and inspect the HeadingLink linkOptions example, then trace the ValidateLinkOptions type involved in the hover error. Reproduce the type error for the search callback while confirming navigation still works. Done means the callback is accepted with type safety like the to and from options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100