Layout for dynamic params
I'm trying to get a route layout to match two dynamics params pages, I'm trying creating a _layoute.tsx page inside the outer $id params but it doesn't seems working
/search
$id
_layoute.tsx
$secondId

2 Replies
robust-apricot•15mo ago
Layout routes require a route configuration (
_layout.tsx
) and a folder/prefixed segment with routes in it.
You can achieve this using a nested or flat file structure.
https://tanstack.com/router/latest/docs/framework/react/guide/routing-concepts#pathless--layout-routesRouting 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
robust-apricot•15mo ago
If you need further help with using layout routes, please create a reproduction on Stackblitz and post it here.
Router stackblitz starter
StackBlitz
Router Quickstart File Based Example - StackBlitz
Run official live example code for Router Quickstart File Based, created by Tanstack on StackBlitz