I'm a bit confused about the routing docs vs. the actual codebase. When starting a new project, I see this in the routes file:
import { type RouteConfig, index } from "@react-router/dev/routes";
export default [index("routes/home.tsx")] satisfies RouteConfig;
However, the docs show a completely different approach using <Routes>, <Route>, and <BrowserRouter> components. The examples in the docs don't match what's in the default app structure at all.
Questions:
Why is there such a big difference between the docs and the default codebase?
Which approach should I be following as a beginner?
Is there documentation that better aligns with the new index() based routing?
Would really appreciate some guidance on the best learning path here! Thanks in advance.