React TutorialLesson 41Free preview
React Router
This lesson is part of React · All levels
Summary
React Router is a client-side library routing that maps the URL to the React component without reloading the page. You set up the BrowserRouter at the root and then you declare the route with the pairs of Routes and Routes that are linked via Link. Features such as useParams and useNavigate help read parameters and move pages programmatically.
Key points
- Install the react-router-dom package
- BrowserRouter is wrapping up the entire app
- Routes contain a set of routes pairs of paths and elements
- Link replaces the <a> tag so that navigation without reload
- UseParams for URL parameters and useNavigate to move
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.