Skip to content

Commit

Permalink
fix: 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js committed Sep 26, 2023
1 parent 62d0b17 commit 4b2b3df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ const router = createBrowserRouter(
},
],
},
{
path: '*',
element: <NoMatch />,
},
],
},
{
path: '*',
element: <NoMatch />,
},
],
{
basename: import.meta.env.BASE_URL,
Expand Down
7 changes: 7 additions & 0 deletions src/pages/[all].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import {
useLocation
} from "react-router-dom";

function NoMatch() {
const location = useLocation();

return (
<div className="container mx-auto px-4">
<h1 className="text-center mt-3">404</h1>
<p>No match for <code>{location.pathname}</code></p>
</div>
);
}
Expand Down

0 comments on commit 4b2b3df

Please sign in to comment.