Skip to content

Commit a6723c1

Browse files
committed
React routes and about page
1 parent 9071773 commit a6723c1

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/App.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
import { BrowserRouter as Router } from 'react-router-dom';
1+
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
22
import './css/App.css';
33
import AppHeader from './components/AppHeader';
44
import AppFooter from './components/AppFooter';
5-
import Home from './pages';
5+
import Home from './pages/Home';
6+
import About from './pages/about';
67

78
function App() {
89
return (
910
<div className="App">
1011
<Router>
1112
<AppHeader></AppHeader>
12-
<Home />
13+
<Routes>
14+
<Route path="/" element={<Home />} />
15+
<Route path="about" element={<About />} />
16+
</Routes>
1317
<AppFooter></AppFooter>
1418
</Router>
1519
</div>

src/pages/About.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const About = () => {
2+
return (
3+
<div>
4+
<h1>This is the About me page</h1>
5+
</div>
6+
);
7+
};
8+
9+
export default About;
File renamed without changes.

0 commit comments

Comments
 (0)