React Router & Navigation
React turns your site into a Single Page Application (SPA). Instead of requesting new HTML from the server for every page, React Router intercepts clicks and dynamically swaps out components based on the URL.
The Router Hierarchy
Everything starts with the <BrowserRouter>. It provides routing context to the rest of the application. Inside, we use <Routes> to group our individual <Route> definitions.
Navigating Without Reloading
If you use a standard HTML <a href="/..."> tag, the browser will reload the entire application, destroying your React state. Instead, we use the <Link to="/..."> component to cleanly update the URL and change views.
Dynamic Routes & Parameters
Sometimes you need a route like `/users/1` or `/users/2`. We define this as path="/users/:id". Inside the rendered component, we can access this dynamic ID using the useParams() hook provided by React Router.
View Full Transcript+
This section contains the full detailed transcript covering routing basics in React. We covered the shift from MPA (Multi-Page Applications) to SPA architecture. We looked at how to install `react-router-dom`, configure the `BrowserRouter`, define `Routes`, create navigation `Links`, and extract URL segments using `useParams`.
