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,18 +1,24 @@
import React from 'react';
import { Router, Route } from 'react-router-dom';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import Navigation from './Navigation';
import history from '../history';
import Home from './Home';
import Github from './Github';
function App() {
return (
<div className="App">
<Router history={history}>
<Navigation />
<Route path="/" exact component={Home} />
</Router>
</div>
);
const App = (props) => {
return (
<div className="App">
<BrowserRouter history={history}>
<div>
<Navigation />
<Switch>
<Route path="/" exact component={Home} />
<Route path="/github" component={Github} />
</Switch>
</div>
</BrowserRouter>
</div>
);
}
export default App;