aboutsummaryrefslogtreecommitdiff
path: root/src/components/App.js
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-06-15 19:20:04 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-06-15 19:20:04 +0530
commite21a1c15a2e4bf3e51cdd7a5671bbfee5837ef13 (patch)
treebfeaa64c1d2ac00570d104ae9ee0e60720d55ba5 /src/components/App.js
parent4f67c1cca24ac93f5e8b7a9108c028e6c2794d74 (diff)
Using react-router to switch pages
Diffstat (limited to 'src/components/App.js')
-rw-r--r--src/components/App.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/components/App.js b/src/components/App.js
index 4e6157a..64057b8 100644
--- a/src/components/App.js
+++ b/src/components/App.js
@@ -7,17 +7,25 @@
*/
import React from "react";
+import {BrowserRouter, Route, Switch} from "react-router-dom";
+
import Header from "./Header/Header";
import HomePage from "./Pages/HomePage";
+import BillingPage from "./Pages/BillingPage";
const App = () => {
- const showHeader = false;
return (
<>
- {showHeader && <Header/>}
+ <BrowserRouter>
+ <Header/>
<div className={"root-content"}>
- <HomePage />
+ <Switch>
+ <Route exact path="/" component={HomePage}/>
+ <Route exact path="/BillingPage" component={BillingPage}/>
+ <Route path="/" render={() => <div>404</div>}/>
+ </Switch>
</div>
+ </BrowserRouter>
</>
);
}