Skip to content

Commit

Permalink
docs(router): route-tree setup instructions for code-based routing
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCassiere committed Sep 19, 2024
1 parent b2b2a23 commit 2dbec57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/framework/react/guide/code-based-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ const layoutBRoute = createRoute({
getParentRoute: () => layoutRoute,
path: 'layout-b',
})

const routeTree = rootRoute.addChildren([
// The layout route has no path, only an id
// So its children will be nested under the layout route
layoutRoute.addChildren([layoutARoute, layoutBRoute]),
])
```

Now both `/layout-a` and `/layout-b` will render the their contents inside of the `LayoutComponent`:
Expand Down

0 comments on commit 2dbec57

Please sign in to comment.