Router changed to BrowserRouter

Router was causing bug that prevented render when Link was clicked
This commit is contained in:
Camerin 2021-09-15 15:48:02 -04:00
parent 043943f6a1
commit 4b164b6ed9
1 changed files with 16 additions and 10 deletions

View File

@ -1,16 +1,22 @@
import React from 'react'; import React from 'react';
import { Router, Route } from 'react-router-dom'; import { BrowserRouter, Route, Switch } from 'react-router-dom';
import Navigation from './Navigation'; import Navigation from './Navigation';
import history from '../history'; import history from '../history';
import Home from './Home'; import Home from './Home';
import Github from './Github';
function App() { const App = (props) => {
return ( return (
<div className="App"> <div className="App">
<Router history={history}> <BrowserRouter history={history}>
<div>
<Navigation /> <Navigation />
<Switch>
<Route path="/" exact component={Home} /> <Route path="/" exact component={Home} />
</Router> <Route path="/github" component={Github} />
</Switch>
</div>
</BrowserRouter>
</div> </div>
); );
} }