Skip to main content

Adding a Router

Create React App doesn't prescribe a specific routing solution, but React Router is the most popular one.

To add it, run:

npm install react-router-dom

Alternatively you may use yarn:

yarn add react-router-dom

To try it, delete all the code in src/App.js and replace it with any of the examples on its website. The Basic Example is a good place to get started. For more info on adding routes, check out the React Router docs on adding routes.

Note that you may need to configure your production server to support client-side routing before deploying your app.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy