I am using React router to change routes. This works well when I develop locally.
My router code looks like this and everything works perfectly.
<Router>
<Route exact path="/" render={(routeProps)=> <Homepage {...routeProps} />}/>
<Route path="/graph" render={(routeProps)=> <AboutPage {...routeProps} />}/>
</Router>
The issue I am having is when I deploy it to my github page, http://exampleuser.github.io/react-project.
As the project is in a react-project folder this "/" refers to the actual route which is http://exampleuser.github.io/
Can anyone advise how the path should look so it works when deployed?
<Switch>?import <Switch> from 'react-router-dom'and then wrap everything in a<div>and then wrap all<Route>'s inside<Switch>Switch- I believe it is to do with the route once I have deployed as it is no longer"/""/"<Route>in the last not the first?