#Layout for dynamic params

2 messages · Page 1 of 1 (latest)

primal folio
#

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

limber whale
#

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.

// nested
src/routes
  out-layout.tsx  // localhost/out-layout
  _layout.tsx
  _layout/
    in-layout.tsx // localhost/in-layout
// flat
src/routes
   out-layout.tsx  // localhost/out-layout
  _layout.tsx
  _layout.in-layout.tsx // localhost/in-layout

https://tanstack.com/router/latest/docs/framework/react/guide/routing-concepts#pathless--layout-routes

TanStack Router supports a number of powerful routing concepts that allow you to build complex and dynamic routing systems with ease.

The Root Route