# Migration Plan: React Router v6 to TanStack Router Migrating a large, dynamic application like Polymech from React Router DOM to TanStack Router requires a phased approach. TanStack Router offers superior type safety, built-in scroll restoration, and powerful data loading capabilities, but fundamentally changes how routing is configured (moving away from JSX `` trees to a static route tree). ## Phase 1: Setup and Basic Configuration - [ ] **Install Dependencies** - Run `npm install @tanstack/react-router @tanstack/router-vite-plugin` in `pm-pics`. - Also install in `@polymech/ecommerce` if needed, or handle it as a peer dependency. - [ ] **Vite Configuration** - Add `TanStackRouterVite` to `vite.config.ts`. This enables file-based routing generation or static tree compilation. - [ ] **Define the Root Route** - Create `src/routes/__root.tsx`. - Migrate the layout shell from `AppWrapper` into the Root Route, including: - `` - `` and `