Skip to main content

React Router: Routes, Links and Parameters

Learn React Router: Routes, Links and Parameters (Phase 8 · React Router (Essential), ReactJS) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Client-side routing • A single-page app has one HTML page. React Router maps URLs to components and updates the address bar without a page reload (History API). • Install: npm install react-router-dom . Wrap the app in a router and declare <Route path element> entries. • Use <Link to> / <NavLink> (never a plain <a href> for internal links, which reloads the page). NavLink adds an active class.

More lessons in Phase 8 · React Router (Essential)