T
TanStack4mo ago
itchy-amethyst

Reading that route path is empty.

Have routing that is $ida/$idb . I need to persist an item in the $ida route, but this item needs to access the current idb value to determine weather to make this item invisible or not. Which I normally do through
const idb= useParams({from: '/$ida/$idb/'}).idb;
const idb= useParams({from: '/$ida/$idb/'}).idb;
However when I visit $ida page, it errors with Invariant failed: Could not find an active match from "/$ida/$ifb/" I could get around this by turning idb into a query param, but ideally this should be a pathing thing. Any strategies to get $ida route to read that there is no $idb
2 Replies
sensitive-blue
sensitive-blue4mo ago
please provide a complete minimal example, e.g. by forking one of the existing router examples on Stackblitz
itchy-amethyst
itchy-amethystOP4mo ago
Turns out the solution is doing something like const idb= useParams({strict: false})?.idb;

Did you find this page helpful?