Grokking React Fundamentals
0% completed
Nested Routes, URL Parameters and Navigation
The store built in the previous lesson has three pages, Home, About and Products, and a PageNav navigation bar above them, built from Link or NavLink elements. Its App component maps each path to one page:
import { BrowserRouter, Routes, Route } from "react-router"; import PageNav from "./PageNav"; import Home from "./Home"; import About from "./About"; import Products from "./Products"; function App() { return ( <BrowserRouter> <PageNav /> <Routes> <Route path="/" element={<Home />} /> <Route path="/about" element={<About />} />
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%