Getting Started with React Router v7
React Router v7 unifies standard React Router with the data capabilities of Remix. It is now a full-stack capable framework when used with the Vite plugin.
Installation
To start a new project:
bash
1npm create react-router@latest my-appThe Vite Plugin
v7 uses a Vite plugin to handle routing automatically.
ts
1// vite.config.ts
2import { reactRouter } from "@react-router/dev/vite";
3import { defineConfig } from "vite";
4
5export default defineConfig({
6 plugins: [reactRouter()],
7});This setup enables file-system routing, loaders, and actions right out of the box.