Skip to content

Commit 0ee993b

Browse files
authored
docs: Use named component in react quick-start (#5061)
1 parent 79fe58f commit 0ee993b

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

docs/router/framework/react/quick-start.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,23 @@ Create the following files:
7676
import { createRootRoute, Link, Outlet } from '@tanstack/react-router'
7777
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
7878

79-
export const Route = createRootRoute({
80-
component: () => (
81-
<>
82-
<div className="p-2 flex gap-2">
83-
<Link to="/" className="[&.active]:font-bold">
84-
Home
85-
</Link>{' '}
86-
<Link to="/about" className="[&.active]:font-bold">
87-
About
88-
</Link>
89-
</div>
90-
<hr />
91-
<Outlet />
92-
<TanStackRouterDevtools />
93-
</>
94-
),
95-
})
79+
const RootLayout = () => (
80+
<>
81+
<div className="p-2 flex gap-2">
82+
<Link to="/" className="[&.active]:font-bold">
83+
Home
84+
</Link>{' '}
85+
<Link to="/about" className="[&.active]:font-bold">
86+
About
87+
</Link>
88+
</div>
89+
<hr />
90+
<Outlet />
91+
<TanStackRouterDevtools />
92+
</>
93+
)
94+
95+
export const Route = createRootRoute({ component: RootLayout });
9696
```
9797

9898
#### `src/routes/index.tsx`

0 commit comments

Comments
 (0)