npm install react-router-dom
Into App.js:
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
<Switch>
or exact
can be used to render out the components 1 at a time.
"/"
is first...the other components will no longer render; as soon as it finds that route with the specific path it stops looking ...so the other components, you will never see if you try to go to the path; it will stop at "/"
. However, 'exact' is the easiest way since you don't have to re-order anything and can just add 'exact' on the specific component with path "/".@jashloper the link to the repo does not work could you please publish it again.
Ps : thanks for your explication
React Router allows you to create paths that render the components. When a user clicks a link, data doesn't have to get grabbed from a server, instead it simply renders the component to the screen - whatever path it's set to. (no refreshing or anything)