T
TanStack14mo ago
wise-white

is route sorting broken, or is it my understanding?

https://stackblitz.com/edit/tanstack-router-dsvamt?file=src%2Froutes%2Fproduct.%24id.specs.tsx With two routes defined as - Product: /product/$id - Product Specs: /product/$id/specs Clicking a link to Product Specs actually renders Product. I would have expected Product Specs to be deemed more specific and so sorted before Product.
Jason Galea
StackBlitz
Router Quickstart File Based Example (forked) - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz
3 Replies
wise-white
wise-whiteOP14mo ago
Routing Concepts | TanStack Router React Docs
TanStack Router supports a number of powerful routing concepts that allow you to build complex and dynamic routing systems with ease. The Root Route
xenial-black
xenial-black14mo ago
If these are two individual pages, that don't inherit a route from products.tsx, then it could be named as - products.$id.index.tsx - products.$id.specs.tsx
wise-white
wise-whiteOP14mo ago
ah, nice, that's probably better, thanks!

Did you find this page helpful?