This project introduced me to routing - using the current browser URL to determine what content to show a user. React Router v5 was installed, as v6 introduced changes that break the starter code.
- Installing react-router-dom from the terminal
- Enabling routing by wrapping contents in the BrowserRouter component
- Adding routes with the Route component
- Static routes (without URL parameters, e.g. /users)
- Dynamic routes (with URL parameters, e.g. /users/:userId)
- Using the useParams hook to access the values of URL parameters
- Declaratively redirecting users by rendering the Redirect component
- Imperatively redirecting users by accessing the history object via the useHistory hook and calling its methods (goForward, goBack, push)
- Accessing the value of query parameters using the useLocation hook
Please note that in each project, the first commit is always the starter code provided by Codecademy.