A route that grew four components
Don't
// app/routes/dashboard.tsx — 1,400 lines
export default function Dashboard() { /* … 300 lines of JSX … */ }
function MetricCard() { /* … */ }
function UsageChart() { /* … */ }
function InviteForm() { /* … */ }
const transformUsage = (rows) => { /* … */ }Do
// app/routes/dashboard.tsx — 90 lines
import { MetricCard } from "@/features/dashboard/metric-card"
import { UsageChart } from "@/features/dashboard/usage-chart"
import { InviteForm } from "@/features/dashboard/invite-form"
import { transformUsage } from "@/features/dashboard/usage"
export default function Dashboard() { /* … the page, and only the page … */ }Each extracted piece is now testable and reusable on its own, and the next agent asked to change the invite form opens a 60-line file instead of reading 1,400 to find it.