Skip to content

Commit

Permalink
#31 [ Router ] React Router
Browse files Browse the repository at this point in the history
  • Loading branch information
fdhhhdjd committed Sep 21, 2023
1 parent a340f0e commit 8c273c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/routers/3.Route Specificity/NotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const NotFound = () => {
return (
<>
<h2>Page Not Found</h2>
</>
);
};

export default NotFound;
2 changes: 2 additions & 0 deletions src/routers/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Link, Route, Routes } from 'react-router-dom';
import Home from './2.Dynamic Routes/Home';
import About from './2.Dynamic Routes/About';
import Detail from './2.Dynamic Routes/Detail';
import NotFound from './3.Route Specificity/NotFound';

const Main = () => {
return (
Expand All @@ -29,6 +30,7 @@ const Main = () => {
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/detail/:id" element={<Detail />} />
<Route path="*" element={<NotFound />} />
</Routes>
</div>
</React.Fragment>
Expand Down

0 comments on commit 8c273c9

Please sign in to comment.