Skip to content

Commit 748205f

Browse files
Merge pull request #48 from mspronesti/master
fix(routes): protect from invalid routes
2 parents 48320f9 + 536d287 commit 748205f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/App.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import About from "./components/About/About";
66
import Projects from "./components/Projects/Projects";
77
import Footer from "./components/Footer";
88
import Resume from "./components/Resume/ResumeNew";
9-
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
9+
import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";
1010
import "./style.css";
1111
import "./App.css";
1212
import "bootstrap/dist/css/bootstrap.min.css";
@@ -32,9 +32,10 @@ function App() {
3232
<ScrollToTop />
3333
<Switch>
3434
<Route path="/" exact component={Home} />
35-
<Route path="/project" component={Projects} />
36-
<Route path="/about" component={About} />
37-
<Route path="/resume" component={Resume} />
35+
<Route path="/project" exact component={Projects} />
36+
<Route path="/about" exact component={About} />
37+
<Route path="/resume" exact component={Resume} />
38+
<Redirect to="/" />
3839
</Switch>
3940
<Footer />
4041
</div>

0 commit comments

Comments
 (0)