Skip to content

Commit

Permalink
Merge pull request #428 from MastanSayyad/main
Browse files Browse the repository at this point in the history
Bug 🐞 Routing Navigation Error "404 Page Not Found" After Refreshing Pages
  • Loading branch information
PranavBarthwal authored Jun 23, 2024
2 parents 7e48a68 + 60c230a commit 8b366e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ function Navbar() {
</li>
{renderAPODLink()}
<li className="navbar-list-item" onClick={handleMenuClose}>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/mars-rover">MartianImagery</NavLink>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/marsrover">MartianImagery</NavLink>
</li>
<li className="navbar-list-item" onClick={handleMenuClose}>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/nasa-projects">NASA's Projects</NavLink>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/nasaprojects">NASA's Projects</NavLink>
</li>
<li className="navbar-list-item" onClick={handleMenuClose}>
<NavLink className={({ isActive }) => ("rem-default " + (isActive ? ' active' : ''))} to="/about">About us</NavLink>
Expand Down
6 changes: 3 additions & 3 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const router = createBrowserRouter(
createRoutesFromElements(
<Route path='/' element={<App />}>
<Route index element={<Home />} />
<Route path='mars-rover' element={<MarsRover />} />
<Route path='nasa-projects' element={<NasaProjects />} />
<Route path='about' element={<About />} />
<Route path='/marsrover' element={<MarsRover />} />
<Route path='/nasaprojects' element={<NasaProjects />} />
<Route path='/about' element={<About />} />
<Route path='*' element={<NotFoundPage />} />
</Route>
)
Expand Down
5 changes: 5 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rewrites": [
{"source": "/(.*)", "destination": "/"}
]
}

0 comments on commit 8b366e9

Please sign in to comment.