30+ React Project: https://buymeacoffee.com/dm007/e/403810
Support Me: https://buymeacoffee.com/dm007
Facebook: / dm.web007
Telegram: https://t.me/DMweb007
Instagram: / dm_00000007
LinkedIn: / abu-raihan-512a10332
📝 Description:
In this step-by-step tutorial, you will learn how to set up React Router DOM in your React app using Vite (it works with Create React App (CRA) too).
We’ll walk you through installing the router, creating multiple pages (Home, About, etc.), and adding navigation using BrowserRouter and Route.
📦 Steps Covered:
1️⃣ Set up a React project with Vite or CRA
2️⃣ Run: npm install react-router-dom
3️⃣ Wrap your app with BrowserRouter in main.jsx
4️⃣ Create components like Home.jsx, About.jsx, etc.
5️⃣ Set up routing with Routes and Route
6️⃣ Add Link or NavLink for navigation
7️⃣ Test routes in the browser
✅ Bonus: Handle 404 pages using Route path="*"
🧰 Tools Used: React Router DOM v6+, Vite, React
📅 Updated for 2025
👍 Like & Subscribe for more React tutorials!
💬 Questions? Comment below.