PurplePanda
PurplePanda

Reputation: 683

How to add React Router to an existing create-react-app?

I can't find any tutorial showing how to add React Router to an existing create-react-app. All of them show how to do it when you start a fresh create react app. How do I add it to the half finished create-react-app I'm working on?

Upvotes: 0

Views: 575

Answers (1)

Dananjaya Gokhale
Dananjaya Gokhale

Reputation: 95

1.install react-router-dom (v4).

import {Switch,Route,Link} from 'react-router-dom';
  1. import BrowserHistory,

    now you can use Switch Route Components to play with routing.

Upvotes: 2

Related Questions