T
TanStack•16mo ago
vicious-gold

Path Params in Middle Of Route?

Can a path param be used like so: /route1/$var/add parseParams returns type error: Property '$var' does not exist on type 'Record<never, string>'.ts(2339) or should I be using a different route structure? My use case is four tabs used to filter a table by the $var value and provide CRUD functions for each. They use the same database table but different form fields with some overlapping fields.
1 Reply
vicious-gold
vicious-goldOP•16mo ago
Path Params | TanStack Router React Docs
Path params are used to match a single segment (the text until the next /) and provide its value back to you as a named variable. They are defined by using the $ character prefix in the path, followed by the key variable to assign it to. The following are valid path param paths: $postId

Did you find this page helpful?