Skip to content

Commit

Permalink
fix (routes): redirect to home in case of no path match
Browse files Browse the repository at this point in the history
  • Loading branch information
mspronesti committed Mar 20, 2022
1 parent f3eb275 commit a7e7182
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
BrowserRouter as Router,
Route,
Routes,
Navigate
} from "react-router-dom";
import ScrollToTop from "./components/ScrollToTop";
import "./style.css";
Expand All @@ -34,11 +35,11 @@ function App() {
<Navbar />
<ScrollToTop />
<Routes>
<Route path="/" exact element={<Home />} />
<Route path="/project" exact element={<Projects />} />
<Route path="/about" exact element={<About />} />
<Route path="/resume" exact element={<Resume />} />
<Route path="*" element={<Home />} />
<Route path="/" element={<Home />} />
<Route path="/project" element={<Projects />} />
<Route path="/about" element={<About />} />
<Route path="/resume" element={<Resume />} />
<Route path="*" element={<Navigate to="/"/>} />
</Routes>
<Footer />
</div>
Expand Down

0 comments on commit a7e7182

Please sign in to comment.