route.to not matching ToOptions
I just updated from 1.0.6 to 1.29.2
Using a
The routes still work so my assumption is that
route.to no longer has the trailing / and doesn't match anything in my router.The routes still work so my assumption is that
ToOptions is the wrong type to use here as it expects the trailing / where route.to trims this slash.
Any ideas on how to solve this?
3 Replies
rival-blackOP•2y ago
https://github.com/TanStack/router/pull/1509 Maybe this PR is the answer?
GitHub
feat:
trailingSlashes option on the type level by chorobin · Pull...We can infer trailingSlashes from the router and use it to enforce the to prop when navigating.
trailingSlashes currently has three options: always | never | preserve.
always - we always have a tra...
rival-blackOP•2y ago
LinkProps appears to be the correct type, ToOptions no longer worksfascinating-indigo•2y ago
Yes. You're kind of correct. ATM only index routes have trailing slashes, which is inconsistent with other leaves. Before this suggestion came from the branch but we are only allowing to navigate to a leaf now.
The above pr is meant to make things consistent. Either you have trailing slashes on, off or both