Lesson 26 of 30
87%
React Router
React Router maps URLs to components in a single-page app.
The browser URL changes. The page does not fully reload. React swaps the view.
Install and wrap
javascript
javascript
Link vs a
Link changes the URL without a full refresh. A plain a would dump the whole React tree.
URL params
javascript
Navigate in code
javascript
Tip: Keep BrowserRouter near the root. Routes go where the swapping content lives, under your header.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.