diff options
author | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-06-15 19:20:04 +0530 |
---|---|---|
committer | MikunoNaka <bokuwakanojogahoshii@yahoo.com> | 2021-06-15 19:20:04 +0530 |
commit | e21a1c15a2e4bf3e51cdd7a5671bbfee5837ef13 (patch) | |
tree | bfeaa64c1d2ac00570d104ae9ee0e60720d55ba5 /src/components/App.js | |
parent | 4f67c1cca24ac93f5e8b7a9108c028e6c2794d74 (diff) |
Using react-router to switch pages
Diffstat (limited to 'src/components/App.js')
-rw-r--r-- | src/components/App.js | 14 |
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> </> ); } |