Are you looking to build multi-page web applications using React? One of the key components to achieve this is the React Router framework. It's a powerful tool that enables navigation and routing within your application. In this tutorial, we'll guide you through the basics of React Router in both the hash and browser route modes.

Before we dive in, ensure you have a basic understanding of React and have set up a new React project. If not, we recommend checking out the official React documentation for a quick start.

Setting Up React Router
First, let's install React Router in your project. You'll need both the core library and the DOM router. You can do this with npm:

`npm install react-router-dom`
Basic Importing and Wrapping

Once installed, you can import Router, Route, and Link from 'react-router-dom' in your entry file (usually App.js). Wrap your entire application with the BrowserRouter or HashRouter component depending on your desired routing mode.
`import { BrowserRouter as Router, Route, Link } from 'react-router-dom';`
Routing Modes: Hash vs Browser

React Router supports two routing modes: hash and browser. The hash mode is useful when you're working on a single-page application that doesn't have a server-side routing configuration. It uses the hash part of the URL (e.g., #/) for routing.
Browser mode, on the other hand, is used when you have a server capable of handling different paths (e.g., example.com/home). It doesn't use the hash part of the URL, making it cleaner and more natural.
Configuring Routes

Now that we've set up the necessary imports and routing mode, let's configure some routes. Surround your Route components with the Router component.
Here's a simple example using BrowserRouter:









| ` | ` | ` | ` | ` | ` | `` |
Nested Routing
You can create nested routes by wrapping Route components inside other Route components. This is useful for creating complex web applications with many pages.
NavLink for Active Class
To highlight the active route in your menu, use the NavLink component instead of Link. It'll apply an 'active' class to the currently active link.
`
There you have it! You now know how to set up and use React Router in both hash and browser route modes. Experiment with nested routing and dynamic route parameters to really understand its power.
The React ecosystem is constantly evolving, so keep an eye on the official documentation for the latest updates and features. Happy coding!