大多数项目都从模板开始。让我们使用 React Router 维护的一个基础模板。
npx create-react-router@latest my-react-router-app
现在进入新目录并启动应用程序
cd my-react-router-app
npm i
npm run dev
您现在可以在浏览器中打开 http://localhost:5173
您可以在 在 GitHub 上查看模板 查看如何手动设置您的项目。
我们也有一些 可直接部署的模板 可供您开始使用
npx create-react-router@latest --template remix-run/react-router-templates/<template-name>
下一步:路由