React
React RouterReact Router
React Router handles navigation across different pages.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
React naturally builds "single-page" applications that do not load new HTML files. To create the illusion of multiple pages, developers use React Router. It swaps out different components depending on the URL the user clicks.
Example
Example
Key Points
- It requires installing the `react-router-dom` package.
- `BrowserRouter` wraps the entire application.
- `Routes` groups all the individual paths together.
- `Route` links a specific URL path to a specific component.