prep

React Router

Learning Objectives

You’ve learned how to build applications with React. The different applications and examples were all built on a single page. What if you wanted to have different pages? with each page having its own URL? You will need to introduce a router in your application.

In JavaScript, a router is the piece of code which is in charge of switching between views of your application and keep each view in sync with a specific URL. For example, you could imagine having a homepage reachable from the root path / and a users page with the path /users.

You can use a framework like Next.js or Remix, write this yourself, or use a library. In React, a popular library to help you achieve this is React Router.

React Learn

Complete πŸ§‘πŸΎβ€πŸŽ“ React Router Getting Started Tutorial

Set a timer and stop working on this tutorial after 60 minutes. Write down your blockers and come to class with questions.