router
router copied to clipboard
navigate({ search }) TypeScript error in beta.25
Describe the bug
After upgrading to beta.25 all uses of navigate({ search })
now results in the following TS error:
Type 'any' is not assignable to type 'never'.
example:
navigate({
search: (old) => ({
...old,
resource: newResource,
selected: undefined,
}),
replace: true,
})
Your Example Website or App
see example above, let me know if you need a StackBlitz
Steps to Reproduce the Bug or Issue
Note this happens both with useNearestMatch()
and useMatch(route.id)
Expected behavior
Should not cause TS error
Screenshots or Videos
No response
Platform
"@tanstack/react-router": "0.0.1-beta.25",
Additional context
No response
A stackblitz would be great.
@tannerlinsley Sorry this was my bad, I had an outdated node_modules. Wiped everything and it works with useMatch
now.
I can still reproduce an issue but only with useNearestMatch()
now, which I imagine is the same problem as https://github.com/TanStack/router/issues/372
Here's a stackblitz where search gives a TypeScript error for useNearestMatch()
https://stackblitz.com/edit/tanstack-router-af8ox9?file=src/main.tsx
So can search be empty?
I believe you should have a much better experience now. Give it a shot!