Any way to do a partial or fuzzzy match
I have these paths
"/" | "/app" | "/app/books" | "/app/books/create"
My sidebar has 2 links. the "Home" one which points to /app and a books one which points to /app/books
I want to match "/app/books/create" to the /app/books link but not the /app link
currently I tried const match = router.matchRoute({ to: url }); which only matches exact urls
and const match = router.matchRoute(url); which seems to match everything
I was able to do this with react location using
Is there a recommended way to do this yet?4 Replies
optimistic-gold•4y ago
fuzzy should work just the same in TanStack Router.
If you have a codesandbox or stackblitz that shows otherwise, paste the link into a new github issue.environmental-roseOP•4y ago
Tnx so much. submitted an issue https://github.com/TanStack/router/issues/374
GitHub
Fuzzy option not available on matchRoute · Issue #374 · TanStack/ro...
Describe the bug The fuzzy option does not seem to be available in tanstack router. Something like this will throw a type error and does not work during runtime as well const match = router.matchRo...
environmental-roseOP•4y ago
This seems to work in runtime but showing type errors

optimistic-gold•3y ago
This should be fixed now.