doc: add React Router to the entire application
This commit is contained in:
+11
-4
@@ -1,4 +1,5 @@
|
||||
import React from "react";
|
||||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
|
||||
|
||||
// Import file
|
||||
import Header from "./Header/Header";
|
||||
@@ -8,10 +9,16 @@ import "./App.css";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<section className="app">
|
||||
<Header />
|
||||
<Home />
|
||||
</section>
|
||||
<Router>
|
||||
<section className="app">
|
||||
<Switch>
|
||||
<Route path="/">
|
||||
<Header />
|
||||
<Home />
|
||||
</Route>
|
||||
</Switch>
|
||||
</section>
|
||||
</Router>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user