Skip to content

Commit 64a3d67

Browse files
author
MarcosBrendonDePaula
committed
Document router migration
1 parent f158469 commit 64a3d67

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

LLMD/INDEX.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
- [Live Components](resources/live-components.md) - WebSocket components
3030
- [Live Upload](resources/live-upload.md) - Chunked upload via Live Components
3131
- [External Plugins](resources/plugins-external.md) - Plugin development
32+
- [Routing (React Router v7)](reference/routing.md) - Frontend routing setup
3233

3334
## Patterns & Rules
3435

LLMD/reference/routing.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Routing (React Router v7)
2+
3+
FluxStack uses **React Router v7** via the `react-router` package for web routing.
4+
5+
## Where It Lives
6+
7+
- Router provider: `app/client/src/main.tsx`
8+
- Routes and pages: `app/client/src/App.tsx`
9+
- Pages: `app/client/src/pages/*`
10+
- Shared layout: `app/client/src/components/AppLayout.tsx`
11+
12+
## Why `react-router` (not `react-router-dom`)
13+
14+
In v7, the React Router team recommends using the core `react-router` package
15+
directly for web apps. The `react-router-dom` package remains as a compatibility
16+
re-export for older apps, but new projects should import from `react-router`.
17+
18+
## Example: Adding a New Route
19+
20+
1. Create a page in `app/client/src/pages/MyPage.tsx`
21+
2. Add a route in `app/client/src/App.tsx`:
22+
23+
```tsx
24+
import { MyPage } from './pages/MyPage'
25+
26+
<Route path="/my-page" element={<MyPage />} />
27+
```
28+
29+
3. Add a nav link in `app/client/src/components/AppLayout.tsx`
30+
31+
## Current Demo Routes
32+
33+
- `/` Home
34+
- `/counter` Live Counter
35+
- `/form` Live Form
36+
- `/upload` Live Upload
37+
- `/chat` Live Chat
38+
- `/api-test` Eden Treaty API Test
39+

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ Default routes in the demo app:
8686
- `/upload` Live Upload
8787
- `/api-test` Eden Treaty API Test
8888

89+
### 🧭 Router Package
90+
91+
This project now uses **React Router v7** via the `react-router` package (recommended by the v7 docs).
92+
If you are upgrading from an older setup that used `react-router-dom`, update imports to `react-router`.
93+
8994
### Alternative Installation
9095

9196
```bash

0 commit comments

Comments
 (0)